Commit d2474c9
committed
Address review feedback
- Refresh the restorable copy when a project is reopened from Open Recent.
`loadProject` moves that path to the front of the recent list, so in "last"
mode it becomes the project the next launch resolves to -- but the copy on
disk still held whichever project was opened through the picker last, so its
`sourcePath` no longer matched and the cold start fell back to the
unavailable-project banner. Open A, open B, reopen A from the recent list was
enough to hit it. `openRecentProjectFile` now returns the raw text alongside
the parsed project so the caller can keep the copy in step without re-reading
a URI whose grant may already be gone.
- Measure the snapshot size limit in UTF-8 bytes rather than `text.length`.
The string is written as UTF-8, so a project of three-byte characters (CJK
layer names, accented attribute values in embedded GeoJSON) could be three
times the limit and still pass. `exceedsStartupSnapshotLimit` bounds the byte
count by the code-unit count first and only encodes when that is inconclusive,
so the oversized projects the guard exists to reject are still rejected
without allocating a second copy of them on a phone. Covered by a boundary
test over ASCII, three-byte, and surrogate-pair text.
- State in the capability comment that `mkdir` is already granted by
`fs:default` (its `create-app-specific-dirs` set), so the missing
`fs:allow-mkdir` next to the other explicit command permissions is deliberate
rather than an oversight, and that without the scope entry the copies fail
with "forbidden path".
- Drop the claim that `MAX_STARTUP_SNAPSHOT_BYTES` "matches" the ceiling on a
project fetched by URL. The two share a number today but bound different
things -- a download buffered into memory versus a file kept on disk -- and
neither has to move when the other does, so the wording now says that instead
of implying an invariant nothing enforces.1 parent 2771f74 commit d2474c9
5 files changed
Lines changed: 90 additions & 7 deletions
File tree
- apps/geolibre-desktop
- src-tauri/capabilities
- src
- hooks
- lib
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
701 | 701 | | |
702 | 702 | | |
703 | 703 | | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
704 | 711 | | |
705 | 712 | | |
706 | 713 | | |
| |||
Lines changed: 30 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| |||
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
86 | 112 | | |
87 | 113 | | |
88 | 114 | | |
| |||
188 | 214 | | |
189 | 215 | | |
190 | 216 | | |
191 | | - | |
| 217 | + | |
192 | 218 | | |
193 | | - | |
| 219 | + | |
194 | 220 | | |
195 | 221 | | |
196 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2850 | 2850 | | |
2851 | 2851 | | |
2852 | 2852 | | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
2853 | 2863 | | |
2854 | 2864 | | |
2855 | 2865 | | |
2856 | 2866 | | |
2857 | 2867 | | |
2858 | 2868 | | |
| 2869 | + | |
2859 | 2870 | | |
2860 | 2871 | | |
2861 | 2872 | | |
| |||
2884 | 2895 | | |
2885 | 2896 | | |
2886 | 2897 | | |
2887 | | - | |
| 2898 | + | |
| 2899 | + | |
2888 | 2900 | | |
2889 | 2901 | | |
2890 | 2902 | | |
| |||
2914 | 2926 | | |
2915 | 2927 | | |
2916 | 2928 | | |
2917 | | - | |
| 2929 | + | |
2918 | 2930 | | |
2919 | 2931 | | |
2920 | 2932 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
95 | 117 | | |
96 | 118 | | |
97 | 119 | | |
| |||
177 | 199 | | |
178 | 200 | | |
179 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
180 | 218 | | |
181 | 219 | | |
182 | 220 | | |
| |||
0 commit comments