Skip to content

Conversation

fire-at-will
Copy link
Contributor

@fire-at-will fire-at-will commented Apr 4, 2025

Motivation

This PR is the Android equivalent for RevenueCat/purchases-ios#4952. We recently decided to make the maximum balance for virtual currency balances be bounded by a signed 32-bit integer, so using a Long here in purchases-android is no longer necessary.

Description

This PR changes the VirtualCurrencyInfo's balance field from a Long to an Int. Kotlin Ints are signed 32-bit integers (source), so this is fine. On the Java side of things, the int primitive is also a signed 32-bit int (source), and the Integer class is also a 32-bit signed integer by transitivity since it wraps the int primitive (source).

This is technically a breaking change but that's okay since the Virtual Currency features are still in a beta state in the SDKs.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

Copy link

codecov bot commented Apr 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (virtual-currency-dev@432f9d0). Learn more about missing BASE report.

Additional details and impacted files
@@                   Coverage Diff                   @@
##             virtual-currency-dev    #2332   +/-   ##
=======================================================
  Coverage                        ?   80.37%           
=======================================================
  Files                           ?      282           
  Lines                           ?     9996           
  Branches                        ?     1421           
=======================================================
  Hits                            ?     8034           
  Misses                          ?     1347           
  Partials                        ?      615           

☔ 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.

@fire-at-will fire-at-will changed the title [WIP] Use int for VC Balance Use int for VC Balance Apr 4, 2025
@fire-at-will fire-at-will marked this pull request as ready for review April 4, 2025 16:44
Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@fire-at-will fire-at-will merged commit d5108e8 into virtual-currency-dev Apr 8, 2025
13 checks passed
@fire-at-will fire-at-will deleted the use-int-for-balance branch April 8, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants