Commit 3dc2eed
committed
refactor(CollectorClient): acceptUpdate uses accesses.update (Plan 58 Phase 4c)
Replaces the delete+create pattern (90 lines, token rotation, race window
between delete and create, requester must re-store apiEndpoint) with a
single `connection.updateAccess(id, { permissions })` call.
Behavior change visible to consumers:
- Access id, token, apiEndpoint preserved across update. Wire id becomes
composite `<base>:<serial>` per Plan 66.
- `response/collector-v1` `update-accept` event no longer carries an
`apiEndpoint` field. The doctor's stored apiEndpoint stays valid.
Q2 (locked): lockstep upgrade — no producer-writes-both compat window.
clientData handling (Q6):
- Update payload does NOT include clientData. Server-side `clientData`
merge (verified empirically on Plan 66 demo) preserves the existing
`hdsCollectorClient` object including any legacy `previousAccessIds`
chain from the delete+create era.
- `this.eventData` is unchanged at update time so the snapshot in
`clientData.hdsCollectorClient.eventData` stays correct.
StaleAccessIdError:
- 1-retry budget. If another writer updates the access between the
pendingUpdate load and now (rare, but possible if a doctor issues two
update requests back to back), refetch the access by name and retry.
Two consecutive stale errors propagate.
Missing test coverage: there's no integration test for acceptUpdate in
the existing suite (apptemplates.test.js covers invite create/revoke but
not the update flow). The Phase 4g historical-data audit on demo accounts
will catch live regressions.
488/488 unit tests pass. Lint clean.1 parent 9431d3c commit 3dc2eed
1 file changed
Lines changed: 37 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
514 | | - | |
515 | | - | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
516 | 529 | | |
517 | 530 | | |
518 | 531 | | |
519 | 532 | | |
| 533 | + | |
520 | 534 | | |
521 | 535 | | |
522 | 536 | | |
| |||
527 | 541 | | |
528 | 542 | | |
529 | 543 | | |
530 | | - | |
| 544 | + | |
531 | 545 | | |
532 | 546 | | |
533 | 547 | | |
| |||
559 | 573 | | |
560 | 574 | | |
561 | 575 | | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
571 | 594 | | |
| 595 | + | |
572 | 596 | | |
573 | 597 | | |
574 | 598 | | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
| 599 | + | |
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
| |||
0 commit comments