Skip to content

Widget: Complete placement after upgrade purchase#532

Merged
d4rken merged 1 commit into
mainfrom
fix/widget-upgrade-return
Apr 17, 2026
Merged

Widget: Complete placement after upgrade purchase#532
d4rken merged 1 commit into
mainfrom
fix/widget-upgrade-return

Conversation

@d4rken

@d4rken d4rken commented Apr 17, 2026

Copy link
Copy Markdown
Member

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

  • Root cause: WidgetConfigurationActivity launched MainActivity via startActivity() and never finished itself. On upgrade success, only the Upgrade destination inside MainActivity's nav stack was popped (landing on Overview); WidgetConfigurationActivity stayed unreachable behind MainActivity and setResult(RESULT_OK) was never called, so the Android widget host treated placement as canceled.
  • Introduced EXTRA_UPGRADE_FOR_RESULT as a separate signal from the existing EXTRA_NAVIGATE_TO_UPGRADE, so in-app upgrade navigations (PressControls, Settings) are unaffected and still only pop the Upgrade destination.
  • Rotation works without savedInstanceState: the flag is read from the retained Intent (not removed), so onCreate after rotation re-subscribes and still fires on cached isPro=true via filter { isPro }.take(1).
  • Auto-confirm is gated on state.canConfirm so 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.
  • Works for both gplay billing and FOSS sponsor flows — both signal success via UpgradeRepo.upgradeInfo.

@d4rken d4rken added bug Something isn't working labels Apr 17, 2026
@d4rken d4rken merged commit 7632ba9 into main Apr 17, 2026
10 checks passed
@d4rken d4rken deleted the fix/widget-upgrade-return branch April 17, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant