Skip to content

fix: Propagate Stream Errors through the same Future#1732

Merged
spydon merged 3 commits into
mainfrom
gustl22/stream-error-propagation
Jan 19, 2024
Merged

fix: Propagate Stream Errors through the same Future#1732
spydon merged 3 commits into
mainfrom
gustl22/stream-error-propagation

Conversation

@Gustl22

@Gustl22 Gustl22 commented Dec 15, 2023

Copy link
Copy Markdown
Collaborator

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

Gustl22 commented Jan 18, 2024

Copy link
Copy Markdown
Collaborator Author

@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

spydon commented Jan 18, 2024

Copy link
Copy Markdown
Member

@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

Gustl22 commented Jan 18, 2024

Copy link
Copy Markdown
Collaborator Author

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

Gustl22 commented Jan 18, 2024

Copy link
Copy Markdown
Collaborator Author

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
@spydon spydon deleted the gustl22/stream-error-propagation branch January 19, 2024 06:24
@Gustl22

Gustl22 commented Jan 19, 2024

Copy link
Copy Markdown
Collaborator Author

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