Skip to content

Replace tabs registry with compact device snapshots#331

Merged
danshapiro merged 12 commits into
devfrom
feature/tabs-registry-device-snapshots-dev
May 8, 2026
Merged

Replace tabs registry with compact device snapshots#331
danshapiro merged 12 commits into
devfrom
feature/tabs-registry-device-snapshots-dev

Conversation

@danshapiro
Copy link
Copy Markdown
Owner

Summary

  • Replace the active append-only tabs registry JSONL state with compact v1 manifest/object storage.
  • Track per-client open tab snapshots separately from bounded closed-tab tombstones, with 30 days as the default closed-tab retention.
  • Add WebSocket protocol v5 tab sync, device/client-instance ownership, migration from legacy JSONL, settings UI, and regression coverage for the memory/output-pressure failure mode.

Testing

  • FRESHELL_TEST_SUMMARY="land tabs registry compact state on dev" npm run check

Restart note

The tabs-registry storage migration commits compact state before archiving the legacy JSONL file. Existing browser tabs running the old bundle will need a page refresh after the new server starts because the WebSocket protocol version changed.

@danshapiro danshapiro merged commit e74a564 into dev May 8, 2026
1 check passed
@danshapiro danshapiro deleted the feature/tabs-registry-device-snapshots-dev branch May 8, 2026 22:02
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b6dfaeb1c4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread server/ws-handler.ts
Comment on lines +1807 to +1811
this.sendError(ws, {
code: 'INVALID_MESSAGE',
message: `WebSocket message exceeds ${this.config.maxRegularWsMessageBytes} bytes`,
})
return
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Close oversized WS senders instead of only returning an error

When a message exceeds maxRegularWsMessageBytes, this branch sends INVALID_MESSAGE and returns without closing the socket, so a client can keep the connection open and repeatedly stream oversized frames. Because this check runs before authentication enforcement in the handler, unauthenticated peers can also consume server work until the hello timeout window expires. Restoring a close (for example code 1009) after this error would prevent repeated abuse and match the previous oversized-message containment behavior.

Useful? React with 👍 / 👎.

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