Skip to content

Add attachedStreamIds as text stream metadata#1805

Merged
1egoman merged 2 commits intomainfrom
export-datastream-attachments
Feb 6, 2026
Merged

Add attachedStreamIds as text stream metadata#1805
1egoman merged 2 commits intomainfrom
export-datastream-attachments

Conversation

@1egoman
Copy link
Contributor

@1egoman 1egoman commented Feb 4, 2026

This allows the downstream components-js libraries to determine which "attachments" were sent in a data stream so the attachedFiles interface can be satisfied, as currently the attachedFiles key is never added to a chat message.

Summary by CodeRabbit

  • New Features
    • Text streams now support optional metadata to reference associated stream IDs, enabling correlation between text content and related streamed attachments for improved content organization and synchronization.

This allows downstream libraries to determine which "attachments" were
sent in a data stream so the previous legacy chat message files
interface can be satisfied.
@changeset-bot
Copy link

changeset-bot bot commented Feb 4, 2026

🦋 Changeset detected

Latest commit: ca1f59c

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

This PR includes changesets to release 1 package
Name Type
livekit-client 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

@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

This PR adds support for an attachedStreamIds metadata field to text streams in the livekit-client package. The enhancement enables text content to be associated with other streamed attachments by propagating stream IDs through incoming and outgoing data stream managers.

Changes

Cohort / File(s) Summary
Type Definition
src/room/types.ts
Added optional attachedStreamIds?: Array<string> property to TextStreamInfo interface.
Data Stream Managers
src/room/data-stream/incoming/IncomingDataStreamManager.ts, src/room/data-stream/outgoing/OutgoingDataStreamManager.ts
Propagated attachedStreamIds field through incoming and outgoing text stream initialization and header construction for cross-stream correlation.
Release Documentation
.changeset/spotty-tigers-sort.md
Added changeset entry documenting patch-level version change and metadata enhancement.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A text stream whispers of friends nearby,
With attachedStreamIds painting the sky,
No longer alone, correlations align,
Metadata dances—how perfectly divine! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: adding attachedStreamIds as a new field to text stream metadata, which is reflected across multiple files (types, incoming/outgoing managers).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch export-datastream-attachments

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 014346e and ca1f59c.

📒 Files selected for processing (4)
  • .changeset/spotty-tigers-sort.md
  • src/room/data-stream/incoming/IncomingDataStreamManager.ts
  • src/room/data-stream/outgoing/OutgoingDataStreamManager.ts
  • src/room/types.ts
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-02-03T17:59:43.931Z
Learnt from: 1egoman
Repo: livekit/client-sdk-js PR: 1798
File: src/room/data-track/utils.ts:118-121
Timestamp: 2026-02-03T17:59:43.931Z
Learning: In the client-sdk-js codebase at `src/room/data-track/utils.ts`, the `isBefore()` method in `DataTrackTimestamp` is now wraparound-aware and correctly delegates to `WrapAroundUnsignedInt.isBefore()` to handle sequence number wraparound in comparisons. This behavior was updated following shijing's comment.

Applied to files:

  • src/room/data-stream/incoming/IncomingDataStreamManager.ts
  • src/room/types.ts
🧬 Code graph analysis (1)
src/room/data-stream/outgoing/OutgoingDataStreamManager.ts (1)
src/room/data-stream/incoming/StreamReader.ts (1)
  • info (22-24)
🔇 Additional comments (4)
.changeset/spotty-tigers-sort.md (1)

1-5: Changeset looks good.

src/room/types.ts (1)

145-147: Type extension is consistent and non-breaking.

src/room/data-stream/outgoing/OutgoingDataStreamManager.ts (1)

100-124: Outgoing metadata propagation is consistent.

src/room/data-stream/incoming/IncomingDataStreamManager.ts (1)

186-195: Incoming metadata mapping looks correct.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

size-limit report 📦

Path Size
dist/livekit-client.esm.mjs 86.54 KB (+0.03% 🔺)
dist/livekit-client.umd.js 96.83 KB (+0.01% 🔺)

@1egoman 1egoman merged commit 08c3abc into main Feb 6, 2026
7 checks passed
@1egoman 1egoman deleted the export-datastream-attachments branch February 6, 2026 14:48
@github-actions github-actions bot mentioned this pull request Feb 1, 2026
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