Repository navigation
Commit c5a1d37
fix(communities): keep parked reasons per intent and recompute the sync error after a pass
Address kalvinnchau's P3 on PR #644 (note f4521998). The sync owner kept one
`error` string for halts, parked refusals and transient failures, and cleared
it only when nothing was parked. With an add parked on limit_reached and a
network failure on another upload in the same pass, the retry that then went
through left "Couldn't reach Builderlab." in the rail, hiding the quota
refusal that was still the only outstanding problem; and once a transient
failure overwrote a parked reason, that reason could not come back for the
sign-in.
- sync.ts: `parked` is a Map from intent key to its refusal reason, so the
park branch records the reason with the intent instead of writing `error`.
After a pass goes through and parked intents that were replaced or
withdrawn are pruned, `error` is recomputed from what remains parked (the
first surviving reason, or none), so a transient failure is cleared
unconditionally. Halts still set `error` through `refuse()`, and the
catch path still reports the transient failure until the next pass.
Tests: the note's sequence (A parked on limit_reached, B throws, B's retry
accepted) ends on `{ phase: "error", pending: 1, error: limit_reached }`,
and with A and B parked for different reasons, withdrawing B reports A's
reason. Both fail on the previous sync.ts and pass on this tree.
docs/communities.md says the hint names a still-parked refusal once a retry
goes through, and lists the new coverage.
Validation on this tree: `vitest run src/bundled/builderlab
src/features/communities` 30 files, 433 tests passed; `tsc --noEmit` clean;
`biome check --error-on-warnings` clean on the touched directory.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Matt Toohey <[email protected]>1 parent 8f14c98 commit c5a1d37
3 files changed
Lines changed: 73 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
| 213 | + | |
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
| |||
367 | 368 | | |
368 | 369 | | |
369 | 370 | | |
370 | | - | |
371 | | - | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
372 | 374 | | |
373 | 375 | | |
374 | 376 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
| 573 | + | |
| 574 | + | |
| 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 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
573 | 633 | | |
574 | 634 | | |
575 | 635 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
| 155 | + | |
158 | 156 | | |
159 | 157 | | |
160 | 158 | | |
161 | 159 | | |
162 | | - | |
| 160 | + | |
163 | 161 | | |
164 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
0 commit comments