Commit 76f9bb1
committed
fix(Contact): composite-id-aware modifiedBy / access.id equality (Plan 58 Phase 4f)
Plan 66 introduces composite access ids on the wire — `<base>:<serial>` for
any access that has been updated at least once. Events carry whatever
serial was active at write time, so an event's `modifiedBy` may be bare
while the current access.id is composite (or vice-versa). String equality
breaks silently across the boundary.
`Contact.eventIsFromContact()` now extracts `base` via the new pryv lib's
`parseAccessRef()` helper before comparing. Three sites canonicalised:
- `event.modifiedBy === access.id` (current access)
- `collectorPrevIds.includes(event.modifiedBy)` (clientData.hdsCollectorClient chain)
- `bridgePrevIds.includes(event.modifiedBy)` (clientData.previousAccessIds chain)
The `refBase()` helper is defensive: if `parseAccessRef` is unavailable
(older pryv lib) or parsing throws, it returns the input unchanged — keeps
pre-Plan-66 callers working unchanged.
[CTAQ3] regression test covers: bare event modifiedBy matching composite
access.id; composite event modifiedBy at lower serial matching head;
different base → no match.
489/489 tests pass. Lint clean.1 parent b355608 commit 76f9bb1
2 files changed
Lines changed: 55 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
305 | 320 | | |
306 | 321 | | |
307 | 322 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
9 | 30 | | |
10 | 31 | | |
11 | 32 | | |
| |||
141 | 162 | | |
142 | 163 | | |
143 | 164 | | |
| 165 | + | |
| 166 | + | |
144 | 167 | | |
145 | | - | |
146 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
147 | 174 | | |
148 | | - | |
149 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
150 | 181 | | |
151 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
152 | 187 | | |
153 | 188 | | |
154 | 189 | | |
| |||
0 commit comments