Commit b355608
committed
refactor(Collector.checkInbox): opportunistic legacy-event migration (Plan 58 Phase 4d)
The patient side (Phase 4c) no longer emits `apiEndpoint` on `update-accept`
response events — token is preserved by `accesses.update`. But legacy events
written by the old delete+create patient flow may still sit in inboxes
waiting to be processed, and those carry a meaningful `apiEndpoint` from
the token rotation.
Doctor-side handling now distinguishes the two cases:
- Legacy `update-accept` (responseEvent.content.apiEndpoint set):
- Adopt the rotated apiEndpoint as before (legacy semantic preserved).
- When archiving the response event, write content stripped of
`apiEndpoint` (events.update REPLACES content, verified empirically
on Plan 66 demo).
- New `update-accept` (no apiEndpoint):
- Stored apiEndpoint stays valid; archive without content rewrite.
Idempotency: archive moves the event out of the inbox stream, so re-reads
won't see it. Failed archive → next checkInbox retries same processing.
488/488 tests pass. Lint clean.1 parent 3dc2eed commit b355608
1 file changed
Lines changed: 24 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
216 | 224 | | |
217 | 225 | | |
218 | 226 | | |
| |||
222 | 230 | | |
223 | 231 | | |
224 | 232 | | |
225 | | - | |
226 | 233 | | |
227 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
228 | 240 | | |
229 | 241 | | |
230 | 242 | | |
| |||
244 | 256 | | |
245 | 257 | | |
246 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
247 | 268 | | |
248 | 269 | | |
249 | 270 | | |
| |||
257 | 278 | | |
258 | 279 | | |
259 | 280 | | |
260 | | - | |
261 | | - | |
262 | | - | |
| 281 | + | |
263 | 282 | | |
264 | 283 | | |
265 | 284 | | |
| |||
0 commit comments