Repository navigation
fix(social): a room approval card waits for its own list before naming another owner - #1623
Conversation
|
@Birfy — formal review request for #1623 at tip Ready for review (not a draft). Red first on the pinned base Checks at this tip: One implementation note for the reviewer: the buttonless branch was not deleted — |
…e list (ThinkFlowLab#1607) The room approval dock reads social/status and social/approvals on their own timers, so an empty `mine` can mean 'not loaded yet'. This test holds the approval list back and asserts the dock draws no buttonless 'Waiting for the owner's approval' card before it answers; it is red on the current client and green once the wait is gated on the lists having answered.
…hinkFlowLab#1607) ChatApprovalDock built `mine` from two lists that poll on their own timers, so an empty `mine` could mean 'not loaded yet' or 'somebody else's card'. The no-button 'Waiting for the owner's approval' card now needs both lists answered and neither holding a card for this room; until then the dock draws nothing. The ThinkFlowLab#114 dock test states the answer explicitly instead of relying on a default hook slot.
|
Verdict: PASS at 37202a6 Ran at this tip: The last two commands are the red-first check: the same tip tree with only Scope: tip vs base Review of the change:
Checks at this tip: 16 check runs, all |
Fixes #1607
Owner: Dev2
Reviewer: Reviewer
Written-by: Dev-2
Base: 63f07ef (live
main, read just before the branch was cut)Tip: 37202a6
Tree: 929512775ecc40e9f651b0bc9e1c1f01d2163b92 (read back from
GET /commits/37202a61…)What was wrong
ChatApprovalDockdecides "this card is somebody else's" frommine, which is built from two lists that poll on their own 5 s timers:social/status(items) andsocial/approvals(local).waitingOtherswasmine.length === 0 && room.pendingCount > 0, so an emptyminewas read as "no card of ours" while it equally meant "neither list has answered yet".room.pendingCountonly says the room holds a pending card; it never said whose.The window is the one in the report: the list lags by a poll, the dock draws the no-button
Waiting for the owner's approvalcard for a card that is in fact ours, and one poll later the buttons appear. The sentence is false when it is drawn — nothing is waiting for another owner; that owner's own machine is holding the decision.What changed
plugins/social/client.js, one component (ChatApprovalDock), no server change:statusLoaded,listLoaded), set in the samethenthat stores its rows. A failed call leaves its flag false.waitingOthersneeds both flags, no entry for this room in either list (room.idorroom.face.roomId), androom.pendingCount > 0. Until then the dock draws nothing, which is the neutral state the issue asks for.named(...)lists are built once (held) andminefilters that, so the room check and the card see the same rows.Why this shape and not deleting the branch: the honest case is real — a face room where another home holds the card — and dropping the branch would leave the owner with no hint at all that the room has a pending card. Gating it on the lists having answered keeps that case and removes the guess. An entry for this room that this chat does not draw (a held reply decided on its own bubble,
#418, or in the Bot's chat) also suppresses the card: that card is ours, not another owner's.docs/subsystems/social.mdstates the new condition in the dock paragraph; the changelog fragment ischangelog.d/1607-approval-dock-waiting.fixed.md.Red → green, honestly
Two commits, the test one not folded into the fix:
583dd3bbdf7c— test only:plugins/social/test/approval-dock.test.js. On the base63f07ef6(client atmain) it is 3 tests, 2 pass, 1 fail:#1607: a dock whose lists have not answered yet claims no other owner and draws no buttonless card— the dock renders[no-buttons]Waiting for the owner's approval. The other two are the locks: our own card becomes Approve / Reject once the list answers, and the other-owner card still appears once the list is answered and empty.37202a6134a9— the fix, on top of it:client.js,social.test.js(the#114dock test now states the two flags explicitly instead of relying on a default hook slot), the subsystem doc and the fragment.At the tip:
test/approval-dock.test.js3/3,plugins/social531/531.Files
Checks
TZ=UTC ARCH_DOCS_BASE=63f07ef6 npm run verifyat tree92951277…— exit 0: core 1903, social 531, tree 125, timeline 129, workflow 226,.github549, interop 37, live-e2e 24; oxlint 0 errors (only the repository's pre-existing warnings);build-client --checkclean;arch-docs: OK (5 changed file(s));ds-bot-patches check:ok 10 patches apply cleanly in order,ok core/ equals ds-bot/ + patches/ds-bot/;node .github/scripts/changelog.mjs check— fragments well formed.Not run: no live instance, no browser (the dock is covered by the client bundle test); CI was not waited on.
Checkpoint
{ "pr": 1623, "claim": "Dev2", "issue": 1607, "summary": "The room approval dock read an empty `mine` as 'no card of ours' while it also meant 'neither list has answered yet', so it drew the no-button 'Waiting for the owner's approval' card for a card that was ours. Both lists now record that they answered, and that card needs both flags, no entry for this room in either list, and a pending count. Until then the dock draws nothing. The honest other-owner case and our own Approve / Reject card are pinned by the same test file.", "files": [ "plugins/social/client.js", "plugins/social/test/approval-dock.test.js", "docs/subsystems/social.md" ], "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=63f07ef6 npm run verify, exit 0 (core 1903, social 531, tree 125, timeline 129, workflow 226, .github 549, interop 37, live-e2e 24, oxlint 0 errors); approval-dock.test.js red first on 63f07ef6 2/3, green 3/3 at 37202a61", "result": "green", "at": "37202a6134a9bafbb9fd28e1ba3d7fdf54055afe" }, "next": "none — ready for review" }