Skip to content

Add updateText API #1400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add updateText API #1400

wants to merge 1 commit into from

Conversation

lukasIO
Copy link
Contributor

@lukasIO lukasIO commented Feb 7, 2025

to support editing of messages

Copy link

changeset-bot bot commented Feb 7, 2025

⚠️ No Changeset found

Latest commit: 2118ec3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@lukasIO lukasIO requested a review from bcherry February 7, 2025 13:12
Copy link
Contributor

github-actions bot commented Feb 7, 2025

size-limit report 📦

Path Size
dist/livekit-client.esm.mjs 90.01 KB (+0.19% 🔺)
dist/livekit-client.umd.js 96.09 KB (+0.2% 🔺)

Copy link
Contributor

@bcherry bcherry left a comment

Choose a reason for hiding this comment

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

so this allows reopening a closed a stream to rewrite the text? is it a requirement that the stream was already closed and maybe that it was actually your stream to begin with?

@lukasIO
Copy link
Contributor Author

lukasIO commented Feb 13, 2025

so this allows reopening a closed a stream to rewrite the text?

not really, this is a new stream with a different operationType (update instead of create) and the same streamId of the original message in order to differentiate edits/updates from first-time sends

is it a requirement that the stream was already closed?

yes, you should only update streams that have previously completed, we don't have a good way to enforce this unfortunately

that it was actually your stream to begin with

yeah, that's another short coming of not having a centralised message hub that can enforce these kind of restrictions. The SFU overrides the participant identity if it's not coming from an agent to ensure the sender_identity cannot easily be spoofed by other clients. So the app logic for displaying the chat would have to do the check to ensure that the original message is not being overridden if the participant_identities don't match. This requires however that the app has the original message still in memory.

Also happy with converting this back to a draft if we don't want to support this rn

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