Skip to content

Route new PTS producers through Stream V6 - #7

Closed
robelest wants to merge 1 commit into
robel/pts-v6-foundationfrom
robel/pts-v6-producer
Closed

Route new PTS producers through Stream V6#7
robelest wants to merge 1 commit into
robel/pts-v6-foundationfrom
robel/pts-v6-producer

Conversation

@robelest

Copy link
Copy Markdown
Owner

Stack

  1. Upstream Register Stream V6 storage get-convex/persistent-text-streaming#62 — Stream V6 foundation
  2. Producer and lifecycle routing (this PR)
  3. Engine-aware bounded reader
  4. Browser transport
  5. React integration
  6. Release certification

This PR lives in the fork so its base can be the fork-owned foundation branch. After upstream get-convex#62 merges, this branch can be opened against upstream main with the same isolated diff.

Summary

  • Keep the existing StreamId as a stable facade while creating native V6 storage for every new stream.
  • Elect exactly one producer with an atomic OCC claim; duplicate requests return 205 without invoking the writer.
  • Persist text through Unicode-safe V6 appendMany batches and mirror PTS lifecycle, inactivity timeout, and deletion transactionally.
  • Preserve legacy rows without coreId: they continue using the existing chunk write, status, timeout, and deletion paths with no migration.
  • Bound raw response buffering independently from persistence; punctuation, 100 ms, and 16 KiB trigger durable flushes, and unread/canceled consumers cannot stop final persistence.
  • Preserve getStreamBody for native streams through a finite compatibility snapshot (4,096 events / 4 MiB); the next PR adds the unbounded-history-safe incremental reader.

No public method signatures or HTTP request shapes change in this layer.

Validation

  • 17 tests across component routing and client producer transport
  • Build, package/example/Convex typecheck, ESLint, Prettier, and diff checks
  • Adversarial follow-up review of lifecycle consistency, exact body limits, cleanup starvation, and raw cancellation

Real concurrent claim and delete/append races remain a release-stack integration gate because convex-test runs transactions serially.

Keep stable PTS facade IDs while creating native V6 streams for new data, elect one producer through an OCC claim, and mirror lifecycle, timeout, and deletion transactionally. Preserve legacy chunk rows without migration and bound both durable batching and raw response buffering so slow consumers cannot block persistence.
@pkg-pr-new

pkg-pr-new Bot commented Aug 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@convex-dev/persistent-text-streaming@7

commit: ea868e5

@robelest

Copy link
Copy Markdown
Owner Author

Closing this premature fork-hosted stack PR. The V6 PTS stack will remain local until it is complete and ready to be submitted natively to get-convex.

@robelest robelest closed this Aug 12, 2026
@robelest
robelest deleted the robel/pts-v6-producer branch August 12, 2026 18:37
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