Skip to content

Conversation

@jfversluis
Copy link
Member

Description of Change

We forgot to add IProvideParentValues as a required service on AppThemeResourceExtension. Therefore it would break when used in release mode because it would be trimmed out and not available.

Linked Issues

PR Checklist

Copilot AI review requested due to automatic review settings January 20, 2025 10:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

src/CommunityToolkit.Maui/Extensions/AppThemeResourceExtension.shared.cs:6

  • The newly added required service 'IProvideParentValues' should have test coverage to ensure it is correctly provided and used.
[ContentProperty(nameof(Key)), RequireService([typeof(IServiceProvider), typeof(IProvideParentValues)])]

@bijington bijington merged commit fa3e834 into main Jan 20, 2025
15 checks passed
@bijington bijington deleted the fix-2415 branch January 20, 2025 15:32
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2025
VladislavAntonyuk added a commit to matt-goldman/Maui-1 that referenced this pull request Dec 4, 2025
Ensures temporary directory used by the file picker is
always removed after the file selection is made, regardless
of success or failure. Also improves error handling when
a view controller cannot be retrieved.

Fixes CommunityToolkit#2460
TheCodeTraveler added a commit that referenced this pull request Jan 8, 2026
* Test file saver with export to service mode

* Used correct constructor with asCopy set to true

* Add temporary directory cleanup in file saving process

* Fixes disposal of temporary file on iOS

Ensures temporary directory used by the file picker is
always removed after the file selection is made, regardless
of success or failure. Also improves error handling when
a view controller cannot be retrieved.

Fixes #2460

* Fixes disposal of temporary directory on iOS

Ensures temporary directory used by the file picker is correctly removed on iOS.

Moves the directory removal to the completion handler of the view controller presentation, ensuring it's executed after the picker is dismissed.

Handles exceptions during file removal by re-throwing them after attempting to remove the temporary directory.

* Update src/CommunityToolkit.Maui.Core/Essentials/FileSaver/FileSaverImplementation.macios.cs

Co-authored-by: Copilot <[email protected]>

* Refactor temp file cleanup in FileSaver (macOS/iOS)

Move temp file removal to finally block to ensure cleanup always occurs. Remove redundant cleanup from view controller presentation callback.

* Apply suggestion from @Copilot

Co-authored-by: Copilot <[email protected]>

* Ensure resources are only created if UI is available, improve error message, ensure temp directory is deleted (not just temp file)

* Move dispose to finally

* fix naming

* fix order

* check for index

* rework File/FolderPicker. Removed IDisposable, Added IsCancelled

* Remove `ConfigureAwait(false)`, Implement CancellationToken, Implement `.WaitAsync()`

* Remove invalid `MemberNotNull`s

* Use `ExceptionDispatchInfo.Throw` to improve exception handling

* Remove `ConfigureAwait(false)`, Use `WaitAsync()`

* Remove invalid `MemberNotNull` attributes, Use `ExceptionDispatchInfo.Throw`

* Use `FolderPickerException`

---------

Co-authored-by: Vladislav Antonyuk <[email protected]>
Co-authored-by: Brandon Minnick <[email protected]>
Co-authored-by: Copilot <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] AppThemeResourceExtension crashes the app after updating the community toolkit version to 10.0.0

2 participants