Widget: Complete placement after upgrade purchase#532
Merged
Conversation
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.
What changed
Placing a widget as a non-Pro user and then completing the upgrade purchase used to leave the user on the dashboard — the configured widget was silently discarded instead of being placed on the home screen, forcing the user to start widget setup over.
Technical Context
WidgetConfigurationActivitylaunchedMainActivityviastartActivity()and never finished itself. On upgrade success, only the Upgrade destination inside MainActivity's nav stack was popped (landing on Overview);WidgetConfigurationActivitystayed unreachable behind MainActivity andsetResult(RESULT_OK)was never called, so the Android widget host treated placement as canceled.EXTRA_UPGRADE_FOR_RESULTas a separate signal from the existingEXTRA_NAVIGATE_TO_UPGRADE, so in-app upgrade navigations (PressControls, Settings) are unaffected and still only pop the Upgrade destination.Intent(not removed), soonCreateafter rotation re-subscribes and still fires on cachedisPro=trueviafilter { isPro }.take(1).state.canConfirmso a process-death recovery (losing the in-memory draft) returns the user to the config screen rather than placing a widget with default/invalid state.UpgradeRepo.upgradeInfo.