Add --stream flag to subscribe for mutable message streaming#141
Add --stream flag to subscribe for mutable message streaming#141
Conversation
Upgrade ably SDK from 2.14.0 to 2.18.0 to support mutable messages. Add a --stream flag to `channels subscribe` that concatenates message.append data for the same serial, streaming tokens in-place on TTY terminals. In JSON mode, action and serial fields are included in the output when --stream is enabled. Update the publish command's publisher callback signature to accept the new PublishResult return type from the upgraded SDK.
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on March 4. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Repository UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
WalkthroughThe PR updates the Ably dependency from 2.14.0 to 2.18.0, widens the publisher callback type to optionally return a PublishResult, and introduces a new stream-based output mode to the subscribe command that concatenates inline message data per serial with corresponding test coverage. Changes
Sequence DiagramsequenceDiagram
participant User as User/CLI
participant Subscribe as subscribe.ts
participant Handler as handleStreamMessage
participant Output as Stdout/TTY
User->>Subscribe: channels:subscribe --stream
Subscribe->>Subscribe: Initialize streamCurrentSerial=null, streamAppendCount=0
loop For each received message
Subscribe->>Handler: Process message via handleStreamMessage
alt Message is create/append action
Handler->>Handler: Check if serial matches streamCurrentSerial
alt Serial changed or first message
Handler->>Output: Finalize previous stream (if any) with count
Handler->>Handler: Reset streamCurrentSerial, streamAppendCount=0
end
Handler->>Handler: Increment streamAppendCount
Handler->>Output: Stream/delta output in-place (TTY mode)
else Other action types
Handler->>Output: Display message with standard structured log
end
end
Subscribe->>Handler: finalizeStream() at loop end
Handler->>Output: Emit final count summary
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Upgrade ably SDK from 2.14.0 to 2.18.0 to support mutable messages. Add a --stream flag to
channels subscribethat concatenates message.append data for the same serial, streaming tokens in-place on TTY terminals. In JSON mode, action and serial fields are included in the output when --stream is enabled.Update the publish command's publisher callback signature to accept the new PublishResult return type from the upgraded SDK.
Summary by CodeRabbit
Dependencies
New Features
--streamflag to channel subscription command enabling inline accumulation and display of messages grouped by serial number.Tests