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

Bug fix: Fix errorWidget on dart DDC (web) #950

Merged
merged 4 commits into from
Aug 4, 2024

Conversation

JustusFluegel
Copy link
Contributor

@JustusFluegel JustusFluegel commented Jun 5, 2024

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Bug fix: The errorWidget would never be displayed when running using DDC (dart web) and the HttpGet option, which happens because the catch block currently never gets executed when using streams with await for on dart DDC.
As such this pr refactors the file to use a StreamController instead, re-implementing the original behavior.

⤵️ What is the current behavior?

Placeholder stays displayed even if a error response (e.g. 404) happened, when running using DDC

💥 Does this PR introduce a breaking change?

No, this is a pure bug fix.

🐛 Recommendations for testing

Maybe add a DDC test suite? idk

📝 Links to relevant issues/docs

🤔 Checklist before submitting

  • All projects build
  • Follows style guide lines (code style guide)
  • Relevant documentation was updated
  • Rebased onto current develop

@JustusFluegel JustusFluegel changed the title Refactor for await in web runtime to streamcontroller Bug fix: Fix errorWidget on dart DDC (web) Jun 5, 2024
@JustusFluegel JustusFluegel force-pushed the develop branch 2 times, most recently from a72aa51 to e3d7a9d Compare June 5, 2024 04:42
@mitcoef
Copy link

mitcoef commented Jul 16, 2024

I agree with this change. Even if the mentioned issue is fixed in the future, using the Stream class listen method is much more idiomatic and should thus be preferred regardless.

@martijn00 martijn00 force-pushed the develop branch 3 times, most recently from 49ef6f4 to 3eb4151 Compare July 31, 2024 17:49
@martijn00
Copy link
Member

@JustusFluegel can you fix the unit tests for this?

@JustusFluegel
Copy link
Contributor Author

JustusFluegel commented Jul 31, 2024

Will do that in the next few days, don't have the time to look at it right now :) Thanks for finally taking a look at this tho, appreciate you taking the time

@JustusFluegel
Copy link
Contributor Author

So I've added a try catch which mirrors the old behavior of sending the UnimplementedError of trying to create the stream from the mock cache controller across the output stream as well - I don't know if this is the prettiest solution but it should be the one that mirrors the old code the closest. If you wish to do this in a different way, let me know :)

@martijn00 martijn00 merged commit 1c9d86a into Baseflow:develop Aug 4, 2024
6 checks passed
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.

3 participants