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 bug in frame triggering for BroadcastFrameClock contexts #71

Conversation

jingibus
Copy link
Contributor

@jingibus jingibus commented Dec 3, 2021

Recomposer.runRecomposeAndApplyChanges always waits for a frame tick before recomposing a child composition. As a result, the call to Snapshot.sendApplyNotifications() isn't achieving the desired outcome in the existing code: under test, writes to snapshot state will fail to produce an additional output. snapshotUpdatesTickEnclosingClock illustrates the issue.

To get the test to pass, though, the call to composition.setContent has to be moved to the beginning of launchMolecule. This is probably due to a race within Recomposer.

Also fixes #45.

@DSteve595
Copy link

Sounds like the same behavior I was seeing here.

@jingibus
Copy link
Contributor Author

jingibus commented Dec 3, 2021

Maybe. These changes don't break CounterPresenterTest; however, now I'm realizing that testMolecule (which we're using in the code I modeled this repro test off of) is also sending a frame. So this may not actually fix my issue. 🤔 🤔 🤔 🤔

In any event, I think that the expectation in the test case is reasonable; it would be really confusing in prod if that scenario failed to produce an additional model.

@jingibus
Copy link
Contributor Author

jingibus commented Dec 8, 2021

Pulling until I work out the issues with this PR. It doesn't address my issue as I thought it did, so: needs more work

@jingibus jingibus closed this Dec 8, 2021
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.

Flaky test: MoleculeTest.errorDelayed
2 participants