[FIX] Order editing crash after activity death #9113
Merged
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.
Closes: #9112
Description
Sentry Issue: WOOCOMMERCE-ANDROID-6PW
To reproduce:
don't keep activitiesThe crash happens because 3 fragments use the same ViewModel while inside of the model, it expects specific sets of arguments passed from a Bundle
In the older version of Hilt, for some unclear reason in this situation, it was a passing bundle from the first fragment in the back stack, which was
OrderDetailsFragment, and therefore crash didn't happenWith the update hilt, it passes the latest bundle there - that's why it cannot recover the required
orderIdThe PR passes
orderIdto the fragments so it will be in the Bundle. The workaround is not ideal - we may want to completely redesign the architecture of the taken approachTesting instructions
Images/gif
don't keep activitiesRELEASE-NOTES.txtif necessary.