Skip to content

[HEL-4856] | Flutter | canPresentUpsell() lacks defensive error handling#94

Merged
koyinusa merged 1 commit into
mainfrom
fix/HEL-4856-canPresentUpsell
May 11, 2026
Merged

[HEL-4856] | Flutter | canPresentUpsell() lacks defensive error handling#94
koyinusa merged 1 commit into
mainfrom
fix/HEL-4856-canPresentUpsell

Conversation

@koyinusa

@koyinusa koyinusa commented May 11, 2026

Copy link
Copy Markdown
Collaborator

Note

Low Risk
Low risk: a small platform-guard change that only affects getUpsellWidget behavior on non-iOS/Android targets.

Overview
On non-iOS/Android platforms, getUpsellWidget now returns UpsellViewForTrigger directly instead of running the embedded availability check and falling back to paywallNotShownReplacement.

This ensures the widget surfaces the explicit unsupported-platform message rather than silently rendering the replacement content.

Reviewed by Cursor Bugbot for commit ce6b14e. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Updated upsell widget display for non-iOS and Android platforms to show a platform compatibility message instead of a fallback widget.

Review Change Stack

@koyinusa koyinusa requested a review from salami May 11, 2026 18:10
@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8592dbef-f981-497a-8444-ee5646f2c127

📥 Commits

Reviewing files that changed from the base of the PR and between 2a700b3 and ce6b14e.

📒 Files selected for processing (1)
  • packages/helium_flutter/lib/core/helium_flutter_method_channel.dart

📝 Walkthrough

Walkthrough

getUpsellWidget adds an early-return condition that renders UpsellViewForTrigger directly for non-iOS/Android platforms, bypassing the availability wrapper and fallback replacement widget path.

Changes

Platform-Specific Upsell Widget Rendering

Layer / File(s) Summary
Early Return for Unsupported Platforms
packages/helium_flutter/lib/core/helium_flutter_method_channel.dart
Early-return condition in getUpsellWidget renders UpsellViewForTrigger directly when platform is neither iOS nor Android, skipping UpsellWrapperWidget and its availability checker.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 A widget for platforms that don't quite fit,
Returns straight to view with an early split,
No wrapper delays, no fallback plays,
Just show the truth in unsupported ways! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title references defensive error handling for canPresentUpsell(), but the actual changes modify getUpsellWidget to return early on unsupported platforms, which is not directly about canPresentUpsell() or defensive error handling. Update the title to accurately reflect the main change: something like '[HEL-4856] | Flutter | Return early for unsupported platforms in getUpsellWidget' or clarify what error handling was actually added.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/HEL-4856-canPresentUpsell

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@koyinusa koyinusa merged commit b8cd7c1 into main May 11, 2026
4 checks passed
@koyinusa koyinusa deleted the fix/HEL-4856-canPresentUpsell branch May 11, 2026 21:26
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.

2 participants