Skip to content

MBL-2971: Adjust logic for determining shipping range string#2481

Merged
tonyteate merged 2 commits intomasterfrom
tony/mbl-2971-selected-condition
Mar 5, 2026
Merged

MBL-2971: Adjust logic for determining shipping range string#2481
tonyteate merged 2 commits intomasterfrom
tony/mbl-2971-selected-condition

Conversation

@tonyteate
Copy link
Copy Markdown
Contributor

@tonyteate tonyteate commented Mar 2, 2026

📲 What

Specifically, in the rewards carousel, for Rewards that ship worldwide, ensure that the estimated shipping range displayed is based on the selected shipping rule.

🤔 Why

The estimated shipping range string for a collection of Rewards (as this also applies for Add-Ons) is determined by RewardViewUtils.getEstimatedShippingCostString(). For the rewards carousel, this function is called for each Reward.

Currently, for Rewards that ship worldwide, the estimated shipping range is determined purely by the first shipping rule in the Reward.shippingRules list, regardless of any selected shipping rule. (In this workflow, shippingRules is populated by the Reward.simpleShippingRulesExpanded field from the FetchProjectRewardsQuery query, the order of which is affected by the shipping rules specified on the Project.)

🛠 How

To preserve the existing behavior where needed, update getEstimatedShippingCostString() to accept a boolean 'flag' forceSelectedShippingRule that allows worldwide Rewards to be matched against the selected shipping rule.

When enabled, the behavior of this function is more aligned with the counterpart functions on iOS (see estimatedShippingConversionText, which calls estimatedMinMax()).

👀 See

Before 🐛 After 🦋

📋 QA

  1. View the rewards carousel for the Project https://www.kickstarter.com/projects/active-gaming-pad/gamr-active-gaming-play-pad
  2. Change the selected shipping location to any other country than "United States"
  3. Confirm that the shipping range displayed for the rewards matches those on the web for the same selected location.
  4. Note that in the current version of the app, the displayed shipping range is always for "United States" regardless of the selected shipping location.

Story 📖

[MBL-2971] [Investigate] US-based backer seeing AU/NZ shipping ranges - Jira

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 3, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 28.57143% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.42%. Comparing base (235311d) to head (87e748c).

Files with missing lines Patch % Lines
...java/com/kickstarter/libs/utils/RewardViewUtils.kt 28.57% 0 Missing and 5 partials ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2481      +/-   ##
============================================
+ Coverage     64.38%   64.42%   +0.04%     
- Complexity     2427     2432       +5     
============================================
  Files           385      385              
  Lines         29190    29195       +5     
  Branches       4227     4230       +3     
============================================
+ Hits          18794    18809      +15     
+ Misses         8131     8103      -28     
- Partials       2265     2283      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tonyteate tonyteate force-pushed the tony/mbl-2971-selected-condition branch from ecd53f9 to 87e748c Compare March 5, 2026 16:17
@tonyteate tonyteate marked this pull request as ready for review March 5, 2026 19:48
@tonyteate tonyteate merged commit 7c737c3 into master Mar 5, 2026
3 checks passed
@tonyteate tonyteate deleted the tony/mbl-2971-selected-condition branch March 5, 2026 20:34
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.

3 participants