Sweep: Midnight Observer throws error on start-up (✓ Sandbox Passed)#76
Open
sweep-ai-deprecated[bot] wants to merge 6 commits into
Open
Sweep: Midnight Observer throws error on start-up (✓ Sandbox Passed)#76sweep-ai-deprecated[bot] wants to merge 6 commits into
sweep-ai-deprecated[bot] wants to merge 6 commits into
Conversation
Contributor
Author
Sandbox Executions
Check app/lib/observers/midnight_observer.dart with contents: |
Contributor
Author
Rollback Files For Sweep
|
Contributor
Author
Apply Sweep Rules to your PR?
|
2 tasks
Contributor
Author
|
The command: |
Contributor
Author
🚀 Wrote ChangesDone. |
philippkolbe
requested changes
Dec 18, 2023
| if (newUser != null) { | ||
| sub?.cancel(); | ||
| sub = currentDayStream.listen((DateTime currentDay) async { | ||
| sub = currentDayStream.listen((DateTime currentDay) async { |
Owner
There was a problem hiding this comment.
is it listening twice to the currentDayStream now?
Contributor
Author
There was a problem hiding this comment.
🚀 Wrote Changes
Done.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Feedback (click)
Description
This pull request addresses an issue where the Midnight Observer throws an error on start-up. The issue occurs when the
authStreamemits anullvalue before emitting a non-null value. To fix this, the pull request adds theasynckeyword to theauthStream.listencallback function, allowing the use ofawait. Additionally, a delay of zero seconds is added usingFuture.delayed(Duration.zero)to ensure that the callback is executed asynchronously. The pull request also includes a check to ensure thatnewUseris notnullbefore canceling the subscription and performing further actions.Summary
app/lib/observers/midnight_observer.dartasynckeyword to theauthStream.listencallback functionFuture.delayed(Duration.zero)newUseris notnullbefore canceling the subscription and performing further actionsFixes #72.
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can: