Daily use 41: Acceptance (#533) #649

Merged
charles merged 5 commits from dailyuse-41-acceptance into dailyuse 2026-11-15 13:59:22 +00:00
Owner

What this builds

  • apps/fluxer/tests/dailyuse_acceptance.rs: the Daily use acceptance as one session of the whole client against the devserver's dailyuse scenario, driven only by the actions of the rows of the core's menus and models (channel/member/guild menus, status popout, friends page, invite cards, quick switcher, report modal, NavActions, the participant menu's model) and checked on the published snapshots, the --record REST log (bodies and statuses), the --record gateway log (the server's echoes), the op 3s at the devserver and a fake notifier. Steps and assertions are tabled in docs/acceptance/dailyuse.md. A second test repeats "Mark as unread" on dailyuse_legacy_ack.toml (bulk ack 404, per-message fallback with the same manual/mention_count).
  • docs/acceptance/dailyuse.md: spec §2 item by item, the manual smoke of --devserver dailyuse (what was clicked and seen), Charles's live checklist for items 1–12 against Electron, the open follow-ups/bugs, the known gaps (spec §13, §14).
  • Parity corrections asked by the orchestrator: "Copy … ID" rows are plain done since #639 (#597 closed), Ctrl+Shift+L and the lightbox copy link keep no toast (#638); "Guild menu | Join, Stop previewing" and "Invite card | Preview" are later (7); follow-ups #640 (editing roles), #641 (Ctrl+I), #642 (Ctrl+U) opened and named in their rows; voice.md "Change friend nickname, Add note" back to later (7) (the participant menu has no such rows).

Bugs found by the acceptance, fixed here

  • #644 — a mention that arrives while the client runs never badged its channel. read_state only took mention counts from READY/acks. Now a MESSAGE_CREATE from someone else, newer than the read marker, for which notif_settings::mentions_me holds adds one (muted or not), as the original's recordUnread (ReadStates.ts:566-576). Test: mute_consumers.rs::live_mention_badges_muted_channel (failed first, passes now). Reviewer: messages.rs::unread_derived_from_last_message_ids asserted the old Foundation rule ("mention counts only ever come from the server"); it now expects 1 for an unmuted DM message, which is the original's rule. Please check you agree this is a correction, not a weakened assertion.
  • #643 — no devserver run could show settings surviving a restart (--devserver is PersistenceKind::Ephemeral). Added Runtime::with_devserver_settings() (doc(hidden), for tests): the settings file under the runtime's Paths is read and written; token and cache are still never stored; --devserver alone is unchanged. Unit test devserver_settings_file_survives_a_restart. This touches apps/fluxer/src/runtime.rs (outside the task's Files list).

Deviations from the plan

  • "create a community → leave it": the original does not let the owner leave (CANNOT_LEAVE_GUILD_AS_OWNER, GuildMenuData.tsx:459); the test asserts the created community's menu has no "Leave community" and leaves "Lounge" (joined through the card just before) instead.
  • "block mallory": she is blocked in the scenario's READY, so the test unblocks her from Blocked users first (her messages show), then blocks her from her member menu (they fold again).
  • "server-mute a member (PATCH asserted)": the test checks participant_menu::model has "Community mute" and sends the action its row maps to; participant_menu::update needs an iced Point, and apps/fluxer does not depend on iced.
  • POST /guilds with an icon is not recorded by design (dailyuse_rt.rs), so the creation is asserted on the server's GUILD_CREATE (name, icon, owner).
  • The PASSIVE_UPDATES step waits on the devserver's real 30 s clock (up to 45 s); the whole test takes ~30 s.

Tested

  • FLUXER_SCREENSHOT_TESTS=1 FLUXER_LIVEKIT_TESTS=1 cargo xtask ci on the host: green (==> xtask ci: all steps passed, at 330bf1dd)
  • Screenshot suite on lavapipe (the CI Linux renderer, in the fluxer-native-shots:u2204 container): 171 passed, 0 failed. No golden was added or redrawn.
  • FLUXER_DESKTOP_TESTS=1 tests: not run.
  • Manual smoke: flaxative --devserver dailyuse in a private Xvfb driven with xdotool (no interaction with the desktop session); log in docs/acceptance/dailyuse.md. Findings filed: #645, #646, #647, #648.

Issues opened

#640, #641, #642 (parity follow-ups), #643, #644 (bugs, fixed here), #645, #646, #647, #648 (from the smoke). Known gaps not re-reported: #597 (closed by #639), #598, #602, #623, #629, #632–#636, #638, #362.

Closes #533
Closes #643
Closes #644

🤖 Generated with Claude Code

## What this builds - `apps/fluxer/tests/dailyuse_acceptance.rs`: the Daily use acceptance as one session of the whole client against the devserver's `dailyuse` scenario, driven only by the actions of the rows of the core's menus and models (channel/member/guild menus, status popout, friends page, invite cards, quick switcher, report modal, `NavAction`s, the participant menu's model) and checked on the published snapshots, the `--record` REST log (bodies and statuses), the `--record` gateway log (the server's echoes), the op 3s at the devserver and a fake notifier. Steps and assertions are tabled in `docs/acceptance/dailyuse.md`. A second test repeats "Mark as unread" on `dailyuse_legacy_ack.toml` (bulk ack 404, per-message fallback with the same `manual`/`mention_count`). - `docs/acceptance/dailyuse.md`: spec §2 item by item, the manual smoke of `--devserver dailyuse` (what was clicked and seen), Charles's live checklist for items 1–12 against Electron, the open follow-ups/bugs, the known gaps (spec §13, §14). - Parity corrections asked by the orchestrator: "Copy … ID" rows are plain done since #639 (#597 closed), Ctrl+Shift+L and the lightbox copy link keep no toast (#638); "Guild menu | Join, Stop previewing" and "Invite card | Preview" are `later (7)`; follow-ups #640 (editing roles), #641 (Ctrl+I), #642 (Ctrl+U) opened and named in their rows; `voice.md` "Change friend nickname, Add note" back to `later (7)` (the participant menu has no such rows). ## Bugs found by the acceptance, fixed here - **#644 — a mention that arrives while the client runs never badged its channel.** `read_state` only took mention counts from READY/acks. Now a `MESSAGE_CREATE` from someone else, newer than the read marker, for which `notif_settings::mentions_me` holds adds one (muted or not), as the original's `recordUnread` (`ReadStates.ts:566-576`). Test: `mute_consumers.rs::live_mention_badges_muted_channel` (failed first, passes now). **Reviewer:** `messages.rs::unread_derived_from_last_message_ids` asserted the old Foundation rule ("mention counts only ever come from the server"); it now expects 1 for an unmuted DM message, which is the original's rule. Please check you agree this is a correction, not a weakened assertion. - **#643 — no devserver run could show settings surviving a restart** (`--devserver` is `PersistenceKind::Ephemeral`). Added `Runtime::with_devserver_settings()` (`doc(hidden)`, for tests): the settings file under the runtime's `Paths` is read and written; token and cache are still never stored; `--devserver` alone is unchanged. Unit test `devserver_settings_file_survives_a_restart`. This touches `apps/fluxer/src/runtime.rs` (outside the task's Files list). ## Deviations from the plan - "create a community → leave it": the original does not let the owner leave (`CANNOT_LEAVE_GUILD_AS_OWNER`, `GuildMenuData.tsx:459`); the test asserts the created community's menu has no "Leave community" and leaves "Lounge" (joined through the card just before) instead. - "block mallory": she is blocked in the scenario's READY, so the test unblocks her from Blocked users first (her messages show), then blocks her from her member menu (they fold again). - "server-mute a member (PATCH asserted)": the test checks `participant_menu::model` has "Community mute" and sends the action its row maps to; `participant_menu::update` needs an iced `Point`, and `apps/fluxer` does not depend on iced. - `POST /guilds` with an icon is not recorded by design (`dailyuse_rt.rs`), so the creation is asserted on the server's `GUILD_CREATE` (name, icon, owner). - The `PASSIVE_UPDATES` step waits on the devserver's real 30 s clock (up to 45 s); the whole test takes ~30 s. ## Tested - `FLUXER_SCREENSHOT_TESTS=1 FLUXER_LIVEKIT_TESTS=1 cargo xtask ci` on the host: green (`==> xtask ci: all steps passed`, at 330bf1dd) - Screenshot suite on lavapipe (the CI Linux renderer, in the `fluxer-native-shots:u2204` container): 171 passed, 0 failed. No golden was added or redrawn. - `FLUXER_DESKTOP_TESTS=1` tests: not run. - Manual smoke: `flaxative --devserver dailyuse` in a private Xvfb driven with xdotool (no interaction with the desktop session); log in `docs/acceptance/dailyuse.md`. Findings filed: #645, #646, #647, #648. ## Issues opened #640, #641, #642 (parity follow-ups), #643, #644 (bugs, fixed here), #645, #646, #647, #648 (from the smoke). Known gaps not re-reported: #597 (closed by #639), #598, #602, #623, #629, #632–#636, #638, #362. Closes #533 Closes #643 Closes #644 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Copy ID rows are plain done since #639; Ctrl+Shift+L and the lightbox copy link
keep no toast (#638). Guild menu Join/Stop previewing and the invite card's Preview
are later (7). Follow-ups #640 (editing roles), #641 (Ctrl+I), #642 (Ctrl+U).
voice.md: the participant menu has no nickname/note rows: later (7).

Refs #533

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A MESSAGE_CREATE from someone else, newer than the read marker, that mentions the user
(notif_settings::mentions_me) adds one to the channel's mention count, as the original's
recordUnread (fork fluxer_app/src/features/read_state/state/ReadStates.ts:566-576). Until
now mention counts only came from READY and acks, so a new @mention never badged until
the next READY (found by the Daily use acceptance). A channel being read acks it back to 0
right after, as before. messages.rs::unread_derived_from_last_message_ids encoded the old
behaviour ("mention counts only ever come from the server") and now expects the
original's count for a DM message.

Refs #533, #644

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--devserver keeps nothing (PersistenceKind::Ephemeral), so no devserver run could show
that drafts, recent searches and [navigation] survive a restart. Runtime::
with_devserver_settings() (doc(hidden), for tests) reads and writes the settings file
under the runtime's Paths; the token and the cache are still never stored, and
--devserver alone never touches the real files.

Refs #533, #643

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
apps/fluxer/tests/dailyuse_acceptance.rs: one session of the whole client against the
devserver's dailyuse scenario, driven by the actions of the core's menus and models and
checked on snapshots, the --record REST and gateway logs, the devserver's op 3s and a
fake notifier: restart (draft, recent search, last channel) -> mute #general 15 min (whole
override map, sent and echoed) -> no notification, a mention badges -> DND 1 h (PATCH, op
3) -> custom status -> accept hedy, unblock and re-block mallory (blocked groups) -> join
Lounge through an invite card -> create a community -> leave Lounge -> Ctrl+K, Alt+Down x2,
Escape -> the full voice channel -> community-mute grace -> mark a mention unread (and
again with legacy_ack) -> report a message -> PASSIVE_UPDATES.

docs/acceptance/dailyuse.md: what is covered, the manual smoke of --devserver dailyuse,
Charles's live checklist (spec 2 items 1-12), follow-ups and known gaps (spec 13, 14).

Refs #533

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #533

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Independent review: Daily use 41 (acceptance)

Reviewed git diff origin/dailyuse...origin/dailyuse-41-acceptance (330bf1dd; own changes only, after the merge of 978a6a97).

CI: FLUXER_SCREENSHOT_TESTS=1 FLUXER_LIVEKIT_TESTS=1 cargo xtask ci in a clean review worktree: green (all steps passed). dailyuse_acceptance run 3 times in a row: 3/3 green, 30.6 s each.

Checked

  • #644 (live mention count): checked against ReadStates.ts:507-579 (handleIncomingMessage), ReadStateIncomingMessageMachine.ts and ReadStateEntry.shouldMentionFor / ReadStateMentionMachine.ts. Own messages are excluded (author check). Blocked authors are excluded (mentions_me). A user mention badges even when muted. @everyone/@here and roles respect suppress_everyone/suppress_roles and the unjoined-thread rule. Private channels badge only when unmuted. A message covered by the read marker does not badge (last_read < id = isCoveredByAck). The channel being read and focused is acked back to 0 by follow_view, which runs after add_mention in the same apply. An unfocused or scrolled-up channel keeps the badge, as shouldAutomaticallyAck does. Edits do not count, and deletes do not decrement (rebuild() keeps mentionCount by default). Nothing in the core synthesises MESSAGE_CREATE, so a resume replay counts exactly as the original's would. READY, MESSAGE_ACK and READ_STATE_UPDATE replace the count rather than adding to it, so the local count is never added on top of the server's. The change to messages.rs::unread_derived_from_last_message_ids corrects a wrong assumption: an unmuted DM message is a mention under isUnmutedPrivateChannel. It does not weaken the test.
  • #643: devserver_settings defaults to false. Only with_devserver_settings() sets it, and its one caller is the acceptance test, which uses Paths::under(tempdir). Plain --devserver still runs Ephemeral(None), which reads and writes nothing. Token and cache operations stay no-ops in both modes.
  • Acceptance test: each step asserts an outcome: recorded REST bodies and statuses, gateway echoes, the op 3s at the devserver, snapshots through the views' selectors, and the fake notifier. Deviations:
    • The owner cannot leave their own community: confirmed in GuildMenuData.tsx:459 (!isOwner).
    • Mallory is unblocked and then blocked again: fine, since she starts blocked.
    • The participant-menu row → ServerMute link is already covered by fluxer-ui/tests/participant_menu.rs (CommunityMute(false) → ServerMute).
    • Checking the creation on GUILD_CREATE is fine.
  • Parity spot-checks: ReadStates.ts:566-576, GuildMenuData.tsx:459 and ReadStates.ts:369-384 all match their citations. The parity doc rows (Copy ID done, #638, preview rows later (7), #640–#642, voice.md later (7)) agree with the PR.
  • Issues #643–#648: each has steps and the commit it was seen on. Labels: bug, and follow-up+parity for #648. No duplicates among existing issues; #646 is a sibling of the closed #610, not the same bug.
  • No new fixtures. No platform-cfg imports in the new test or the runtime builder. No secrets. add_mention uses saturating_add.

Findings

  1. minor: crates/fluxer-core/src/read_state.rs:5-7 and crates/fluxer-core/README.md:63 still say mention counts "are never counted locally". They are now (#644). Update both.
  2. minor: apps/fluxer/tests/dailyuse_acceptance.rs ("a mention still badges") asserts mention_count > before and >= 1. A double count, or the plain "lunch anyone?" badging, would still pass. Assert == before + 1 once the mention has arrived.
  3. minor: dailyuse_acceptance.rs (DND for 1 hour) checks only status: "dnd" and that custom_status is absent. The "1 hour" part (status_resets_at about 1 h ahead, status_resets_to: "online") is never asserted on the wire. Only the smoke log shows it.
  4. minor: dailyuse_acceptance.rs (PASSIVE_UPDATES) does not assert that Big is read at the start of session 2, so the step is only meaningful because of the fixture's read states. The step also waits on the real 30 s clock: low flake risk (first tick at READY+30 s, 45 s limit, 3/3 runs at 30.6 s), but it adds ~30 s to every CI run. DevServer::passive_tick() already exists; exposing it through Handle (like chat_script()) would make the step instant and deterministic. Follow-up material.
  5. minor (pre-existing, now affects counts): crates/fluxer-core/src/notif_settings.rs:830-836 excludes mention_everyone in 1:1 DMs. A muted DM with an @everyone therefore does not badge, while the original's hasEveryoneMention would. Very rare. Worth a note in #644 or a follow-up.

Verdict: approved. No blocking findings, and CI is green.

## Independent review: Daily use 41 (acceptance) Reviewed `git diff origin/dailyuse...origin/dailyuse-41-acceptance` (330bf1dd; own changes only, after the merge of 978a6a97). **CI:** `FLUXER_SCREENSHOT_TESTS=1 FLUXER_LIVEKIT_TESTS=1 cargo xtask ci` in a clean review worktree: green (`all steps passed`). `dailyuse_acceptance` run 3 times in a row: 3/3 green, 30.6 s each. ### Checked - **#644 (live mention count)**: checked against `ReadStates.ts:507-579` (`handleIncomingMessage`), `ReadStateIncomingMessageMachine.ts` and `ReadStateEntry.shouldMentionFor` / `ReadStateMentionMachine.ts`. Own messages are excluded (author check). Blocked authors are excluded (`mentions_me`). A user mention badges even when muted. @everyone/@here and roles respect `suppress_everyone`/`suppress_roles` and the unjoined-thread rule. Private channels badge only when unmuted. A message covered by the read marker does not badge (`last_read < id` = `isCoveredByAck`). The channel being read and focused is acked back to 0 by `follow_view`, which runs after `add_mention` in the same `apply`. An unfocused or scrolled-up channel keeps the badge, as `shouldAutomaticallyAck` does. Edits do not count, and deletes do not decrement (`rebuild()` keeps `mentionCount` by default). Nothing in the core synthesises `MESSAGE_CREATE`, so a resume replay counts exactly as the original's would. READY, `MESSAGE_ACK` and `READ_STATE_UPDATE` replace the count rather than adding to it, so the local count is never added on top of the server's. **The change to `messages.rs::unread_derived_from_last_message_ids` corrects a wrong assumption**: an unmuted DM message is a mention under `isUnmutedPrivateChannel`. It does not weaken the test. - **#643**: `devserver_settings` defaults to false. Only `with_devserver_settings()` sets it, and its one caller is the acceptance test, which uses `Paths::under(tempdir)`. Plain `--devserver` still runs `Ephemeral(None)`, which reads and writes nothing. Token and cache operations stay no-ops in both modes. - **Acceptance test**: each step asserts an outcome: recorded REST bodies and statuses, gateway echoes, the op 3s at the devserver, snapshots through the views' selectors, and the fake notifier. Deviations: - The owner cannot leave their own community: confirmed in `GuildMenuData.tsx:459` (`!isOwner`). - Mallory is unblocked and then blocked again: fine, since she starts blocked. - The participant-menu row → `ServerMute` link is already covered by `fluxer-ui/tests/participant_menu.rs` (`CommunityMute(false)` → `ServerMute`). - Checking the creation on `GUILD_CREATE` is fine. - **Parity spot-checks**: `ReadStates.ts:566-576`, `GuildMenuData.tsx:459` and `ReadStates.ts:369-384` all match their citations. The parity doc rows (Copy ID done, #638, preview rows later (7), #640–#642, `voice.md` later (7)) agree with the PR. - **Issues #643–#648**: each has steps and the commit it was seen on. Labels: `bug`, and `follow-up`+`parity` for #648. No duplicates among existing issues; #646 is a sibling of the closed #610, not the same bug. - No new fixtures. No platform-`cfg` imports in the new test or the runtime builder. No secrets. `add_mention` uses `saturating_add`. ### Findings 1. **minor**: `crates/fluxer-core/src/read_state.rs:5-7` and `crates/fluxer-core/README.md:63` still say mention counts "are never counted locally". They are now (#644). Update both. 2. **minor**: `apps/fluxer/tests/dailyuse_acceptance.rs` ("a mention still badges") asserts `mention_count > before` and `>= 1`. A double count, or the plain "lunch anyone?" badging, would still pass. Assert `== before + 1` once the mention has arrived. 3. **minor**: `dailyuse_acceptance.rs` (DND for 1 hour) checks only `status: "dnd"` and that `custom_status` is absent. The "1 hour" part (`status_resets_at` about 1 h ahead, `status_resets_to: "online"`) is never asserted on the wire. Only the smoke log shows it. 4. **minor**: `dailyuse_acceptance.rs` (`PASSIVE_UPDATES`) does not assert that Big is read at the start of session 2, so the step is only meaningful because of the fixture's read states. The step also waits on the real 30 s clock: low flake risk (first tick at READY+30 s, 45 s limit, 3/3 runs at 30.6 s), but it adds ~30 s to every CI run. `DevServer::passive_tick()` already exists; exposing it through `Handle` (like `chat_script()`) would make the step instant and deterministic. Follow-up material. 5. **minor (pre-existing, now affects counts)**: `crates/fluxer-core/src/notif_settings.rs:830-836` excludes `mention_everyone` in 1:1 DMs. A muted DM with an @everyone therefore does not badge, while the original's `hasEveryoneMention` would. Very rare. Worth a note in #644 or a follow-up. **Verdict: approved.** No blocking findings, and CI is green.
charles merged commit c68dddd6c6 into dailyuse 2026-11-15 13:59:22 +00:00
Sign in to join this conversation.
No description provided.