Skip to content
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

Fixing group streams #406

Merged
merged 4 commits into from
Sep 26, 2024
Merged

Fixing group streams #406

merged 4 commits into from
Sep 26, 2024

Conversation

nmalzieu
Copy link
Collaborator

@nmalzieu nmalzieu commented Sep 26, 2024

Introduction 📟

Sometimes groups were not getting streamed well in the RN SDK, especially when streaming messages at the same time

Purpose ℹ️

Make group streaming still work even if streaming all messages at the same time

Scope 🔭

We were using a single StreamHolder so when cancelling a Task if something was streamed we were detecting it (with for instance Task.isCancelled and calling self.streamHolder.stream?.end() on a stream which might not be the one we thought! Using an actor inside each streaming method to save & end the stream fixes it.

Testing 🧪

I never managed to do a reproducible test directly in Swift. However I do have a failing test in the React Native repo: can stream groups and messages is failing on iOS on my side, but if I bring these Swift changes inside the XMTP Pod, it passes.

See xmtp/xmtp-react-native#503

Copy link
Contributor

@nplasterer nplasterer left a comment

Choose a reason for hiding this comment

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

Nice find! Probably need to bump the pod so we can get it in RN.

@nplasterer nplasterer enabled auto-merge (squash) September 26, 2024 16:10
@nplasterer nplasterer merged commit 70502e2 into main Sep 26, 2024
1 of 2 checks passed
@nplasterer nplasterer deleted the noe/fix-groups-streams branch September 26, 2024 16:16
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