Skip to content

refactor(frontend): split log stream transport and history into modules - #5525

Merged
abcxff merged 6 commits into
mainfrom
stack/refactor-frontend-split-log-stream-transport-and-history-into-modules-qvpxmyts
Jul 31, 2026
Merged

refactor(frontend): split log stream transport and history into modules#5525
abcxff merged 6 commits into
mainfrom
stack/refactor-frontend-split-log-stream-transport-and-history-into-modules-qvpxmyts

Conversation

@abcxff

@abcxff abcxff commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@claude

claude Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review

Verified this is a pure code-move refactor: use-deployment-logs-stream.ts (previously ~226 lines of mixed concerns) is split into two focused modules, with the hook re-importing them. I diffed the moved code against the original and it's textually identical (aside from rewriteLogEntry being reordered above parseSseEvent in the new deployment-logs-transport.ts, which is a no-op reorder) — no behavior changes.

Code quality

  • Clean separation: deployment-logs-transport.ts owns SSE parsing/streaming/retry, deployment-logs-history.ts owns the paginated REST history fetch. Both are cohesive, reasonably sized modules.
  • rewriteLogEntry lives in transport.ts and is imported by history.ts rather than duplicated — good, avoids the two modules drifting on the Cloud Run hello-message rewrite logic.
  • Import direction is one-way (history.tstransport.ts), so no circular-import risk.
  • Naming (deployment-logs-history.ts, deployment-logs-transport.ts) is consistent with the existing deployment-logs.tsx / use-deployment-logs-stream.ts kebab-case convention in this directory.
  • cloudEnv, MAX_RETRIES, BASE_DELAY_MS, etc. all stayed correctly scoped to where they're used; no leftover unused imports in the trimmed hook file.

Bugs / correctness

  • None found. This is a mechanical extraction with matching exports/imports wired up correctly on both sides.

Test coverage

  • No tests exist for this hook before or after the change, so nothing regresses here, but flagging that the retry/backoff and SSE-parsing logic in deployment-logs-transport.ts is a reasonable candidate for a focused unit test now that it's isolated in its own module (e.g. parseSseEvent and streamWithRetry's retry/backoff behavior). Not a blocker for this refactor PR.

Minor

  • PR description is empty; per repo convention a short bullet list of what changed would be helpful for reviewers, even though the diff itself is easy to follow here.

Overall: safe, well-scoped refactor. No functional or security concerns.

@abcxff
abcxff force-pushed the stack/refactor-frontend-split-log-stream-transport-and-history-into-modules-qvpxmyts branch from df912a9 to 3385909 Compare July 31, 2026 05:07
@abcxff
abcxff force-pushed the stack/refactor-frontend-de-duplicate-log-stream-lifecycle-writes-ytsztrnu branch from 4a1508b to 3f089b6 Compare July 31, 2026 05:07
@abcxff
abcxff changed the base branch from stack/refactor-frontend-de-duplicate-log-stream-lifecycle-writes-ytsztrnu to main July 31, 2026 05:34
@abcxff
abcxff changed the base branch from main to stack/refactor-frontend-de-duplicate-log-stream-lifecycle-writes-ytsztrnu July 31, 2026 05:35
@abcxff
abcxff changed the base branch from stack/refactor-frontend-de-duplicate-log-stream-lifecycle-writes-ytsztrnu to main July 31, 2026 05:36
@abcxff
abcxff merged commit 3385909 into main Jul 31, 2026
12 of 22 checks passed
@abcxff
abcxff deleted the stack/refactor-frontend-split-log-stream-transport-and-history-into-modules-qvpxmyts branch July 31, 2026 05:36
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