-
Notifications
You must be signed in to change notification settings - Fork 112
only attempt to restore View saved state while INITIALIZED #635
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
Conversation
steve-the-edwards
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this just pulling this fix into main from the ui-update branch?
| // We're only allowed to restore from an INITIALIZED state, but this callback can also be | ||
| // invoked while the owner is already CREATED. | ||
| // https://github.com/square/workflow-kotlin/issues/570 | ||
| ?.takeIf { it.lifecycle.currentState == Lifecycle.State.INITIALIZED } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @rjrjr originally tried this solution but decided against it? I can't remember now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it was just a matter of being able to reproduce the bug first.
If this line is removed, everything still passes except for the new test, even if you call scenario.recreate(), or change orientation or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I feel fine about the fix, just didn't want to do it w/o proof.
| it.nestedTestView().viewState = "some state" | ||
| } | ||
|
|
||
| // Recreating the activity sends one ONE_CREATE event, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤩
|
@RBusarow what changed in those last couple of force pushes? |
And I added that same |
|
Debugging a problem where a I'm starting to think that the real problem here is that Wondering if we should link it and Update: not so much "similar" as maybe related. Like b/c we're squelching the restore call, downstream we puke b/c of trying to consume something that never was restored. |
|
@RBusarow When I revert everything but the test from this, the test still passes. Do you remember if there was any particular AVD or API level you were using to reproduce the failure? |
|
@rjrjr I just tested against a 31 "Pixel 5" AVD and with just the |
|
Perfect, thanks. I don't know that these two issues are actually related, still debugging. |
|
Seems unrelated, just a missing call to |

fixes #570