Skip to content

fix(web): ignore log catch-up replay frames#535

Open
metyatech wants to merge 3 commits into
jonwiggins:mainfrom
metyatech:fix/log-catchup-dedupe
Open

fix(web): ignore log catch-up replay frames#535
metyatech wants to merge 3 commits into
jonwiggins:mainfrom
metyatech:fix/log-catchup-dedupe

Conversation

@metyatech
Copy link
Copy Markdown

@metyatech metyatech commented May 21, 2026

Problem

Task, workflow run, and PR review log views load persisted history through REST and also keep a WebSocket open for live log frames. The WebSocket endpoints replay recent log rows with catchUp: true on connect/reconnect so clients do not miss events.

Those hooks were treating catch-up replay frames like normal live log frames after REST history had already loaded. On reconnect, the same recent log rows could therefore be appended again in the browser, making the log viewer show duplicate entries even though the persisted REST/DB history was not duplicated.

Session logs already avoid this by treating REST history as canonical and ignoring catchUp WebSocket frames. This PR applies the same policy to the other log hooks.

Summary

  • Ignore WebSocket catchUp replay frames in task, workflow run, and PR review log hooks.
  • Keep normal non-catch-up live log frames appending as before.
  • Add regression coverage for catch-up replay frames.
  • Add missing PR review log hook tests.

Verification

  • pnpm --filter @optio/web test -- src/hooks/use-logs.test.ts src/hooks/use-workflow-run-logs.test.ts src/hooks/use-pr-review-logs.test.ts
  • pnpm --filter @optio/web typecheck
  • pnpm format:check
  • pre-push pnpm turbo test completed successfully

Copilot AI review requested due to automatic review settings May 21, 2026 10:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@metyatech metyatech requested a review from Copilot May 21, 2026 11:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

2 participants