Commit cab2374
* 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]>
1 parent 6b1de8d commit cab2374
File tree
6 files changed
+121
-108
lines changed- samples/CommunityToolkit.Maui.Sample/ViewModels/Essentials
- src/CommunityToolkit.Maui.Core/Essentials
- FileSaver
- FolderPicker
6 files changed
+121
-108
lines changedLines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | 91 | | |
95 | 92 | | |
96 | 93 | | |
| |||
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | 82 | | |
86 | 83 | | |
87 | 84 | | |
| |||
Lines changed: 62 additions & 54 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 11 | + | |
16 | 12 | | |
17 | | - | |
| 13 | + | |
18 | 14 | | |
19 | | - | |
20 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
23 | 29 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
27 | 36 | | |
28 | 37 | | |
29 | 38 | | |
30 | 39 | | |
31 | 40 | | |
32 | | - | |
33 | 41 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
37 | 47 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 48 | + | |
| 49 | + | |
44 | 50 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 51 | + | |
| 52 | + | |
54 | 53 | | |
55 | | - | |
56 | | - | |
| 54 | + | |
| 55 | + | |
57 | 56 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 57 | + | |
| 58 | + | |
68 | 59 | | |
69 | | - | |
70 | | - | |
71 | 60 | | |
72 | 61 | | |
73 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
74 | 66 | | |
75 | 67 | | |
76 | 68 | | |
77 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
78 | 91 | | |
79 | | - | |
80 | 92 | | |
81 | | - | |
82 | | - | |
83 | | - | |
| 93 | + | |
84 | 94 | | |
85 | | - | |
86 | | - | |
87 | | - | |
| 95 | + | |
88 | 96 | | |
89 | 97 | | |
90 | 98 | | |
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
18 | 24 | | |
19 | 25 | | |
20 | 26 | | |
| |||
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
27 | | - | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
Lines changed: 45 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 13 | + | |
31 | 14 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 15 | + | |
35 | 16 | | |
36 | | - | |
| 17 | + | |
37 | 18 | | |
38 | 19 | | |
39 | 20 | | |
40 | | - | |
41 | | - | |
42 | 21 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
46 | 38 | | |
47 | | - | |
| 39 | + | |
| 40 | + | |
48 | 41 | | |
49 | | - | |
| 42 | + | |
50 | 43 | | |
51 | | - | |
| 44 | + | |
| 45 | + | |
52 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
53 | 55 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
61 | 62 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 63 | + | |
| 64 | + | |
66 | 65 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
71 | 70 | | |
72 | 71 | | |
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
20 | 26 | | |
21 | 27 | | |
22 | 28 | | |
| |||
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
28 | | - | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
0 commit comments