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

fix: Propagate Stream Errors through the same Future #1732

Merged
merged 3 commits into from
Jan 19, 2024

Conversation

Gustl22
Copy link
Collaborator

@Gustl22 Gustl22 commented Dec 15, 2023

Description

Wait simultaneously for async calls (Futures and Streams) to ensure all errors are propagated through one common future. Previously a stream could throw an error before it was even listened to, as the process still awaited an async call (here setSource).

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, refactor:,
    docs:, chore:, test:, ci: etc).
  • I have read the Contributor Guide and followed the process outlined for submitting PRs.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation and added dartdoc comments with ///, where necessary.
  • I have updated/added relevant examples in example.

The tests are adapted, but not explicitly written to avoid that error. But the error would occur since Flutter 3.16.x, so they are tested against in #1715 without further ado.

Breaking Change

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

Related Issues

#1715

@Gustl22
Copy link
Collaborator Author

Gustl22 commented Jan 18, 2024

@spydon we may can merge this even with the error (?). The problem seems to be solved with the linux workaround in #1715, but this requires pumping Flutter which is also happening there, and requires more changes. This "fix" should be logically independent from bumping, though. It's a chicken-egg-problem.

@spydon
Copy link
Member

spydon commented Jan 18, 2024

@spydon we may can merge this even with the error (?). The problem seems to be solved with the linux workaround in #1715, but this requires pumping Flutter which is also happening there, and requires more changes. This "fix" should be logically independent from bumping, though. It's a chicken-egg-problem.

Let's just merge both? So that it still works for people depending on main

@Gustl22
Copy link
Collaborator Author

Gustl22 commented Jan 18, 2024

Yes, the lib works, even with the change, only the linux test fails, due to a the "pump" bug. But I would prefer to have two separate commits in the main branch, to have them separated in the log / changelog. After that, we can merge #1715

@Gustl22
Copy link
Collaborator Author

Gustl22 commented Jan 18, 2024

Thanks, unfortunately I cannot force merge with unresolved checks, maybe you have the permission to do so...

@spydon spydon merged commit 00d041d into main Jan 19, 2024
6 of 7 checks passed
@spydon spydon deleted the gustl22/stream-error-propagation branch January 19, 2024 06:24
@Gustl22
Copy link
Collaborator Author

Gustl22 commented Jan 19, 2024

Nice 🥳

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