Skip to content

Refetch notes on stage change so obfuscation clears - #40

Merged
ellgreen merged 3 commits into
mainfrom
fix/notes-obfuscated-after-stage-change
Sep 15, 2026
Merged

ellgreen merged 3 commits into
mainfrom
fix/notes-obfuscated-after-stage-change

Conversation

@ellgreen

Copy link
Copy Markdown
Owner

Summary

Moving a retro from reflect to group left other people's notes stuck showing reflect-stage obfuscated noise. Obfuscation is recomputed correctly per request from the retro's current status, but nothing re-fetched notes when that status changed - a per-stage remount used to do this as a side effect until "Keep the notes when the stage changes" (dabd046) removed it, and no replacement was added for the already-open board.

  • Wires status_updated to trigger the existing reconnect refetch, so an open board asks again (and gets correctly de-obfuscated content) on every stage change.
  • Fixes two more instances of the same underlying pattern found while tracing this:
    • dal.NoteList had no ORDER BY, so a full notes fetch (now happening on every stage change too) had no stable order.
    • The note_created reducer case always appended the server-confirmed note to the end instead of swapping it in at the optimistic placeholder's own position, which could reorder notes as people created them concurrently.
    • VotesWithCountFromModel built its result by ranging over a map, so vote-count order in discuss was non-deterministic - the classic Go map-iteration bug.

Test plan

  • go build ./... && go vet ./... && go test -race ./...
  • cd ui && pnpm lint && pnpm exec tsc -b && pnpm test && pnpm build
  • New regression tests at every level: dal/resources/controllers tests against real SQLite, a Vitest reducer case, and a Playwright E2E suite (ui/e2e/reflect-to-group-obfuscation.spec.ts) driving two real browser sessions through the actual reflect → group transition.
  • Verified the E2E test actually catches the regression: reverted just the fix, rebuilt, and it failed showing literal obfuscated noise ("n nadkvhktgwh ampapnb qnxc xul uusmaf vvagj") instead of the typed note; restored the fix and it passed cleanly across repeated runs.
  • Added a CI job to run the Playwright suite, and pnpm test:e2e documented in CLAUDE.md.

🤖 Generated with Claude Code

ellgreen and others added 3 commits September 15, 2026 09:27
Moving a retro from reflect to group left other people's notes stuck
showing reflect-stage obfuscated noise. Obfuscation is recomputed
correctly per request from the retro's current status, but nothing
re-fetched notes when that status changed - a per-stage remount used
to do this as a side effect until "Keep the notes when the stage
changes" (dabd046) removed it, and no replacement was added for the
already-open board. Wire status_updated to trigger the existing
reconnect refetch instead.

Also fixes two more instances of the same underlying pattern found
while tracing this:

- dal.NoteList had no ORDER BY, so a full notes fetch (now happening
  on every stage change too) had no stable order.
- The note_created reducer case always appended the server-confirmed
  note to the end instead of swapping it in at the optimistic
  placeholder's own position, which could reorder notes as people
  created them concurrently.
- VotesWithCountFromModel built its result by ranging over a map, so
  vote-count order in discuss was non-deterministic - the classic Go
  map-iteration bug.

Adds regression coverage at every level: dal/resources/controllers
tests against real SQLite, a Vitest reducer case, and a Playwright E2E
suite driving two real browser sessions through the actual reflect to
group transition (verified this catches the regression: reverting the
fix makes it fail showing literal obfuscated noise instead of the
typed note).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…after-stage-change

# Conflicts:
#	ui/package.json
#	ui/pnpm-lock.yaml
task run's data path is never created by the app itself - task dev
relies on the committed ./data, and the Dockerfile does its own mkdir.
CI's isolated THOUGHTS_DATA_PATH had nothing creating it, so the
server exited on startup before Playwright could reach it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ellgreen
ellgreen merged commit 0ee16c1 into main Sep 15, 2026
3 checks passed
@ellgreen
ellgreen deleted the fix/notes-obfuscated-after-stage-change branch September 15, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant