Architecture review small fixes: migration FK check, web toggles, doc drift #261

closed cmc opened this on 2026-09-28 02:36 UTC · bug docs store web

Discussion

cmc 2026-09-28 02:36 UTC

Small fixes from the architecture review.

  • Migrations with -- foreign_keys: off commit, then run PRAGMA foreign_key_check (internal/store/store.go:237). A violation is reported after the schema and user_version are persisted. Run the check inside the transaction before commit; foreign_key_check works with enforcement off.
  • pinToggle (internal/httpd/accounts.go:241), the watch toggle and mark-read (internal/httpd/notifyweb.go) call the store directly and ignore errors, skipping the dispatch write budget and audit. Route them through their commands.
  • API.org says tokens are minted on the API (line 16) and that token commands are refused by name (line 55); the code allows them. The 401 in internal/httpd/api.go:131 says "mint one over SSH".
  • Parity says batched review is not built; mr comment --pending and publication exist and the web uses them.
  • Threat-Model says secrets never appear in URLs; login links carry ?token=. Document the exception, send Cache-Control: no-store on the login flow, and note that proxies must strip the query from logs.

referenced in commit 7a6343d02d by cmc: wiki: architecture and security pages

2026-09-28 04:30 UTC

referenced in commit 4e0958a163 by cmc: plans: open issues from the architecture and UX reviews

2026-09-28 05:43 UTC

closed by cmc in commit 4ffdc2c645: wiki: fix API token-refusal claim, batched-review status, watch/pin dispatch, login-link URL exception

2026-09-28 22:09 UTC

referenced in commit 8a379d4719 by cmc: web: Cache-Control: no-store on the login-link request

2026-09-28 22:09 UTC

referenced in commit d0e26d3df9 by cmc: web: pin and watch toggles dispatch through repo pin/watch/mute/unwatch

2026-09-28 22:09 UTC

referenced in commit 0338e6ace3 by cmc: store: run foreign_key_check inside the migration transaction, before commit

2026-09-28 22:09 UTC

referenced in commit 7c015c39b3 by cmc: web, store: final-review wording, header and range-diff fixes

2026-09-28 23:23 UTC

referenced in commit f2c5e7302d by cmc: wiki: #261 rows in step with the code

2026-09-29 04:46 UTC

referenced in commit abdeafa214 by cmc: web: mark-read dispatches notifications read

2026-09-29 04:46 UTC