Repository navigation
Read the caller's own digest opt-out back into Project settings - #1879
Merged
Birfy merged 1 commit intoOct 31, 2026
Merged
Conversation
The panel read `project.assistant.off`, a field the host never writes: the opt-out lives
per owner on `project.assistant.owners[ownerId]`. A digest the owner paused therefore opened
unticked, and one Save on an unchanged row sent `off: false` and silently resumed it.
`project-read` now answers `assistantMine: { off, quiet }` for the calling actor, the panel
draws the box from it, and `setOwner` touches the record and the 09:00 task only when the
value actually changes.
Fixes ThinkFlowLab#1845
Collaborator
|
Verdict: PASS at 632c457 Ran at this tip: Review points:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1845
Written-by: Dev-3
Owner: Dev-3
Reviewer: Birfy
Claim-Id: de9b235e787c4b8d825d97566020a16a
Branch: dev/3-p230-assistant-off-readback
Base: 1c44a78
What was wrong
Project settings read
project.assistant.off, a field the host never writes. The digest opt-out is per owner:setOwnerstores it onproject.assistant.owners[<ownerId>].off(core/src/host/project-assistant.js), and the assistant record itself carries only{ botId, sessionId, createdAt, scheduleId? }.project-readreturned the stored Project alone, so the field wasundefinedfor every caller.The reader saw an unticked Pause the daily digest for a digest she had paused, and one Save on that row — even to change something else — posted
settings: { off: false }. The host then storedfalseand sentschedule-resume, so the paused digest ran again the next morning with nothing on screen saying so.What changed
project-readanswers one more field,assistantMine: { off, quiet }, read byrt.projectAssistant.minefromowners[actorId]for the calling actor. No new endpoint, no widening of the write surface; an absent Project still answers exactly{ project: null, canManage: false }, the shape it had.assistantMine.off(the page carries it from the sameproject-read), so each owner sees their own switch and never another owner's;project.assistant.offsurvives only as the fallback a caller with no such read had.setOwnernow touchesrecord.offand the 09:00 task only when the value actually changes: a Save that writes the value already stored neither rewrites the record nor callsschedule-pause/schedule-resume. Thequiet/zonewrites, the owner gate and the pause/resume shape are unchanged.node core/scripts/build-client.mjs→core/client.js+patches/ds-bot/0008-client-bundle.patch;node scripts/ds-bot-patches.mjs generate→patches/ds-bot/0002-flybot-api-host.patchand thefiles/mirrors. One changelog fragment (changelog.d/1845-assistant-off-readback.fixed.md) and one line each indocs/subsystems/core-client.mdandcore-host.md.Red first, on base
1c44a786The new test is in
core/test/project-board-panels.test.jsand goes through the realprojectEndpoint, nocall:stubs: pause throughproject-assistant-owner, read back throughproject-read, draw the panel, Save without touching it, then tick and Save. On the base it fails on the read:The same test on the tip is green, and it fails again when the source change is reverted.
Verification at the tip
632c457fb68209fe5c55e1dc3aeb08b1708f8d5dRan:
TZ=UTC ARCH_DOCS_BASE=1c44a786 npm run verifyon the committed tree (git status --porcelainempty): exit 0 — core 2254/2254; core lint 73 warnings, 0 errors; plugin lints 36 / 9 / 2 / 16 warnings, 0 errors;arch-docs: OK (13 changed file(s));build-client --checkgreen;ds-bot-patches check10 patches apply cleanly in order andcore/ equals ds-bot/ + patches/ds-bot/; plugins social 541, tree 127, timeline 135, workflow 336;.github/scripts561; interop 37, live-e2e 24 — 0 failures everywhere. One earlier run of the same tree failedcore/test/room-external.test.js("a stop is asked for on the protocol before the signal",timed out waiting for the child); that file passes 13/13 twice on its own and the full run above is green.node .github/scripts/changelog.mjs check: 15 fragments well formed.Not run:
deepseek-harnesscheckout beside the repo, and this box has none. The change is two host functions and one client read;project-read's answer and the panel's box are covered by the new test through the real endpoint.Checkpoint
{ "pr": 1879, "claim": "Dev-3", "issue": 1845, "summary": "Project settings read project.assistant.off, which the host never writes, so a paused digest opened unticked and one Save sent off:false and resumed it. project-read now answers assistantMine { off, quiet } for the calling actor and the panel draws the box from it, so each owner sees only their own switch. setOwner writes the record and calls schedule-pause/schedule-resume only when the value changes, so a Save on an untouched row resumes nothing. The generated client bundle and patches, one changelog fragment and one line in each of the two subsystem docs come with it.", "files": [ "core/src/host/store.js", "core/src/host/project-assistant.js", "core/src/client/project-board.js", "core/test/project-board-panels.test.js" ], "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=1c44a786 npm run verify; node .github/scripts/changelog.mjs check", "result": "green", "at": "632c457fb68209fe5c55e1dc3aeb08b1708f8d5d" }, "next": "none — ready for review" }