Repository navigation
fix(quiet-hours): the warning line is the host flag, and the window is not one team-wide clock (#1199) - #1200
Conversation
…s not one team-wide clock (#1199) The page computed the repeat/cron warning a second time from its task list (a bare some()), while the host already puts quietUnchecked on the view with its quiet-hours guard. The two agreed only by construction, and the subsystem page claimed the page renders the host field, which it did not. Now the host is the only place the rule is computed: the page reads view.quietUnchecked, and after the settings write it asks for the view again so the line appears now instead of at the next poll. The same section of core-host.md called the window one team-wide clock; a task's due time is read in that task's own zone, so the sentence now says so and the flag bullet says the page renders the flag. core-client.md carries the page half, which arch-docs asks for when core/client.js and core/src/client/schedules.js change. Tests: the new case puts a view with no repeat task but quietUnchecked true and one with a repeat task and no flag; on the previous page the first renders nothing and the second renders a line, so the case reds. A second case proves the save asks the host again instead of predicting the flag. Reverting the page to its own some() reds exactly those two cases (13 pass / 2 fail).
7a6e761 to
93f010b
Compare
|
Verdict: PASS at 93f010b Reviewed at the tip, with the base equal to the current main ( The three points, each checked on the tip.
Restored afterwards: the file's blob sha1 is back to Ran: The generated half is verified by the check rather than read: Two notes, neither blocking.
|
Owner: Dev
Reviewer: Reviewer
Base: 8fbd78a
Tip SHA: 93f010b
Fixes #1199
Reproduce. The warning line under Quiet hours was computed twice. The host puts
quietUncheckedon the view (core/src/host/schedules.js:327, with itsquietHours.onguard); the page ignored it and ran its ownview.tasks.some(task => task.kind === 'every' || task.kind === 'cron')(core/src/client/schedules.js:263), gated at render time byquiet.on. On today's tree a view with no repeat task butquietUnchecked: truerenders nothing (the host says a rule can still fire, the page stays silent), and a view with a repeat task and no flag renders the line (the page claims what the host did not).docs/subsystems/core-host.md:382described the first wiring as already existing.What changed.
core/src/client/schedules.js: the page readsview.quietUnchecked === trueand the localsome(...)is gone, not left dormant. The host is the only place the rule is computed. Thequiet.onguard stays at render time so a stale flag cannot draw a line with the window off.setPrefs({ quietHours }), the page asks for the view again (actions.schedules?.()→publish) instead of predicting the flag from its own list. Without it the line would appear only at the next 30-second poll ofuseSchedules.docs/subsystems/core-client.md: the page half arch-docs asks for oncecore/client.jsandcore/src/client/schedules.jschange — the line renders the view'squietUncheckedflag, the only computation, and is read again right after the settings write.docs/subsystems/core-host.md: the section's opening sentence no longer calls the window "the team's own clock" — it is a wall clock, but a task's due time is read in that task's own zone (the next bullet), so the two are compared as instants. ThequietUncheckedbullet now says the flag is the only computation and namescore/src/client/schedules.js.changelog.d/1199-quiet-unchecked-flag.fixed.md.core/client.jsrebuilt fromsrc/client(build-client), and the two patches that carry these files regenerated:0001-core-fixes(the onesrc/client/schedules.jssection, spliced into main's file so the other 49 sections stay byte-identical) and0008-client-bundle.patches/ds-bot/files/test/schedules-client.test.jsmirrors the test (that file is one FlyBot adds).Tests (
core/test/schedules-client.test.js, two new cases, nothing else touched):quietUnchecked: truemust render the line, and a view with a repeat task and no flag must not — the flag decides, not the list;actions.schedulescalled at least once), so the line appears now rather than at the next poll.What I ran at
93f010bc0f91a1d65825f1a40f1982c62fd799d7(TZ=UTC,DSH_HARNESSat the local DSH install):Knife (measured, not assumed): putting the page's own
some(...)back and dropping the re-read reds exactly the two new cases — 13 pass / 2 fail — and nothing else.Notes for the reviewer.
gitthis machine cannot rungenerate, so the two patches were written the way the repo's applier reads them (old-side starts exact, new-side starts = old start plus the delta of the earlier hunks, which is the shape the committed files already have).checkrebuildscore/fromds-bot/+files/+ the series and compares it, so a wrong hunk cannot pass it; thepackagejob's owncheck/build is the second opinion.0008-client-bundleis a generated file: the diff is larger than the code change because the bundle inserts 9 lines at ~11413, so every later hunk's true new-side offset moves. Its content change is the one function above.#1166): suppressing a delivery and counting it — DSH has no pre-delivery hook.