Repository navigation
Commit afad69e
committed
Wire subscriptions: fetch, reconcile, and say what happened
SubscriptionFetcher was written and tested and nothing called it, which
is why the node list passed subscription = null. It is connected now,
and the connection is where NW-D-04 actually lives.
NodeStore learned where a node came from, because a feed may only speak
for the nodes it supplied. A refresh leaves manual nodes untouched; a
node the feed stops listing is kept and marked rather than deleted,
since deleting it leaves a shorter list and no explanation, which is
the outcome the requirement exists to prevent; and a subscription that
comes back restores the node in place instead of appending a second
copy. A line with no origin marker reads as manual, which is both
correct and the whole migration — every node written before origins
existed was one the user added by hand.
The subscription URL is a bearer credential and is stored accordingly:
its own file, so a future "export my nodes" cannot sweep it up; written
before the first fetch is attempted, so a correct but unreachable
subscription is still the subscription when the network returns; and
forgetting it deletes the file rather than blanking a field.
Import takes one field for both kinds of link, because a person holding
a link does not necessarily know which kind it is, and the parser can
answer that better than they can.
Three defects a device found:
A fetch launched from rememberCoroutineScope() is cancelled when the
screen closes — which is the same tap. The import screen closed, the
list stayed empty, and nothing reported a failure because nothing had
failed: it had been cancelled. Work that outlives a screen now runs on
the repository's own scope, and subscribe() takes no scope from its
caller because there is no way to hand it one that dies.
Cleartext is blocked at this target SDK, correctly — the URL is a
password. The screen warned about http and left the button enabled, so
the tap silently did nothing at all, which is worse than either
refusing or allowing. A plaintext subscription is now refused at the
input, with the reason and what to ask the provider for.
lastRefreshFailure was kept in the repository and shown nowhere, so a
subscription that could not be reached looked exactly like one with
nothing to say. It is on the node list now — and a subscription failure
renders as a subscription failure rather than borrowing a node's
wording, so an exhausted subscription no longer reads as an unreachable
node.
321 unit tests, 0 failures, 0 skipped. Verified on a device: the http
refusal, and the whole import path.1 parent 071a080 commit afad69e
13 files changed
Lines changed: 631 additions & 40 deletions
File tree
- app
- src
- main
- kotlin/eu/nodepass/somewhere
- data
- ui
- screens
- state
- res
- values-b+zh+Hans
- values-b+zh+Hant
- values
- test/kotlin/eu/nodepass/somewhere
- data
- i18n
- gradle
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
115 | 118 | | |
116 | 119 | | |
117 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
58 | 71 | | |
59 | 72 | | |
60 | 73 | | |
| |||
81 | 94 | | |
82 | 95 | | |
83 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
84 | 112 | | |
85 | 113 | | |
86 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
68 | 71 | | |
69 | 72 | | |
70 | 73 | | |
| 74 | + | |
71 | 75 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
80 | 85 | | |
| 86 | + | |
| 87 | + | |
81 | 88 | | |
82 | 89 | | |
83 | 90 | | |
| |||
124 | 131 | | |
125 | 132 | | |
126 | 133 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
134 | 172 | | |
135 | 173 | | |
136 | 174 | | |
137 | 175 | | |
138 | 176 | | |
139 | 177 | | |
140 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
141 | 211 | | |
142 | 212 | | |
143 | 213 | | |
| |||
234 | 304 | | |
235 | 305 | | |
236 | 306 | | |
237 | | - | |
| 307 | + | |
238 | 308 | | |
239 | 309 | | |
240 | 310 | | |
| |||
243 | 313 | | |
244 | 314 | | |
245 | 315 | | |
246 | | - | |
247 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
248 | 331 | | |
249 | 332 | | |
250 | 333 | | |
251 | 334 | | |
252 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
253 | 339 | | |
254 | 340 | | |
255 | 341 | | |
| |||
259 | 345 | | |
260 | 346 | | |
261 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
262 | 358 | | |
263 | 359 | | |
264 | 360 | | |
| |||
0 commit comments