Skip to content

LTRAC-2599: fix(cli) - Keep log events across logs tail rotations - #3282

Merged
jorgemoya merged 6 commits into
canaryfrom
jorgemoya/ltrac-2599-catalyst-logs-tail-loses-events-during-connection-rotation
Oct 20, 2026
Merged

jorgemoya merged 6 commits into
canaryfrom
jorgemoya/ltrac-2599-catalyst-logs-tail-loses-events-during-connection-rotation

Conversation

@jorgemoya

@jorgemoya jorgemoya commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Linear: LTRAC-2599

What/Why?

catalyst logs tail closed its stream before opening the next one on each 1-minute rotation, so events emitted in that gap were lost. It now opens the next stream before closing the current one (retrying a failed replacement without dropping the current stream), and dedupes events by uuid so the overlap and the tail worker's buffer replay don't print twice.

Pairs with bigcommerce/ignition#414, which forwards the tail worker's buffered events.

Known limits, fixed properly by sequence numbers in LTRAC-2605:

  • More than 100 events queued at handoff can still be lost.
  • More than 10,000 events while the replacement opens can print twice.

Testing

Tests cover the overlap, quiet-stream rotations, dedupe across reconnects (including --format json), failed replacements, and the old stream erroring during the handoff. Typecheck, lint and the logs suite pass.

On integration (with bigcommerce/ignition#414 deployed), 4,800 numbered requests at 20/s over ~5 rotations:

CLI Missing Duplicates
Published 0 479 (~100 per rotation, the tail worker's replay)
This branch 0 0

Migration

None.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
catalyst Ready Ready Preview Oct 19, 2026 10:31pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 444a81f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bigcommerce/catalyst Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

jorgemoya and others added 5 commits October 19, 2026 17:17
The tail closed its stream before opening the next one every minute, so
events emitted in that gap were lost. Open the next stream first and keep
reading the current one until it's ready, and dedupe events by uuid so the
overlap and the tail worker's replay on connect don't print twice.

Fixes LTRAC-2599
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Cancelling a stream that errored during the handoff rejected unhandled and
crashed the tail even when the next stream opened. Also stop racing the
long-lived stop promise per read, which retained every chunk until the
TTL fired.

Refs LTRAC-2599
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tream

A transient failure opening the replacement stream closed the healthy
current one, so nothing was delivered during retries and five failed
attempts ended tailing. Keep reading the current stream while the
replacement is retried, and close it only once one opens or on a fatal
error.

Refs LTRAC-2599
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A stream that received nothing during its TTL was closed before the next
one was requested, so quiet projects still lost events in the gap.
Overlap on every TTL rotation and keep the idle warning. Document that
the dedupe window is sized well above the tail worker's 100-event replay.

Refs LTRAC-2599
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
During a rotation both streams receive live events while the replacement
opens, on top of the tail worker's replay. With more than 1,000 such events
the oldest IDs fell out of the window and whole bursts printed twice.
Raise the window to 10,000 IDs.

Refs LTRAC-2599
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jorgemoya
jorgemoya force-pushed the jorgemoya/ltrac-2599-catalyst-logs-tail-loses-events-during-connection-rotation branch from edf9140 to 0c1b370 Compare October 19, 2026 22:17
Refs LTRAC-2599
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jorgemoya
jorgemoya added this pull request to the merge queue Oct 20, 2026
Merged via the queue into canary with commit b682f25 Oct 20, 2026
16 checks passed
@jorgemoya
jorgemoya deleted the jorgemoya/ltrac-2599-catalyst-logs-tail-loses-events-during-connection-rotation branch October 20, 2026 19:02

This branch was successfully deployed

1 active deployment
Preview — 444a81f7 Deployed Oct 19, 2026 by vercel[bot]
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