Skip to content

review: Guard refreshDecisions against overlapping reads #325

Closed

Description

@cgwalters-bot

Repo: cgwalters-forge/review

Task: refreshDecisions in src/github/main.ts is started from several places (page load, the poll, force on r). Two overlapping calls can finish out of order, so an older read overwrites state.decisions/state.decisionsAnswered with stale data (and the cached-first read can overwrite a live one if it is slow). Add an in-flight guard like refreshOps' opsRunning: a call while one runs does not start a second read, but a force call during a read is remembered and runs once more when the first ends. Also stop the cached-first branch from applying after the live read has landed.

Acceptance: a unit test (extract the sequencing into a small testable function if main.ts can't be imported in tests) with a fake loader that resolves out of order proves the later-started read can't be overwritten by an earlier one, a forced call during a read re-runs once, and an error clears the flag; npm run check (typecheck, tests, build) passes.

Constraints: code and tests only, no GitHub writes (the coordinator opens the PR); no design decisions; do not touch .github/ workflows; keep the change small and match the surrounding style; commit message in the project's style with a Generated-by: AI trailer, no Signed-off-by.

Generated-by: https://github.com/cgwalters/#llms

Activity

  1. added
    dispatchOpt in to the dispatcher's auto-dispatch of a devspace run
    on Oct 3, 2026
  2. removed
    dispatchOpt in to the dispatcher's auto-dispatch of a devspace run
    on Oct 3, 2026
  3. moved this from In Progress to Draft in Workstreamon Oct 3, 2026
  4. cgwalters-bot commented on Oct 7, 2026

    @cgwalters-bot
    CollaboratorAuthor
  5. moved this from Draft to Done in Workstreamon Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions