Skip to content

fix(tipping): floor group minimum balance at one cent - #1712

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/group-min-balance-floor
Oct 7, 2026
Merged

bmc08gt merged 1 commit into
code/cashfrom
fix/group-min-balance-floor

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

A custom group minimum balance could reach the server as a fraction of a cent, which StartChat rejects with INVALID_RULES. The keypad only rejected amounts <= 0, then converted a non-USD entry to USD with no rounding, so 0.5 JPY was sent as about $0.0033.

The server's limit is now documented in the contract (code-payments/flipcash2-client-protocol#26): every MinimumBalanceRequirement must be at least one unit at the currency's last decimal place.

minimumBalanceFor converts the entry to USD, rounds it to cents, and returns null for anything that rounds to $0.00. ConfirmCustomAmount drops a null the same way it dropped an empty entry. This matches iOS, which rounds a converted amount to the cent and rejects $0 (MinimumBalanceAmountSheet.swift). An entry like 1 JPY, about $0.0067, is accepted as $0.01 rather than rejected.

The protobuf mapper is unchanged, and the preset chips ($10/$50/$100) were never affected.

MinimumBalanceFloorTest covers rejecting amounts that round to zero, rounding a fraction of a cent, and the exact one-cent boundary.

The server rejects a MinimumBalanceRequirement below the currency's minimum
transfer value (INVALID_RULES). The custom-amount keypad only rejected <= 0,
so a non-USD entry could convert to a sub-cent USD amount.

Round the converted amount to USD's decimals and reject anything that rounds
to zero, matching iOS.
@bmc08gt bmc08gt self-assigned this Oct 7, 2026
@github-actions github-actions Bot added the type: fix Bug fix label Oct 7, 2026
@bmc08gt
bmc08gt merged commit 64c5677 into code/cash Oct 7, 2026
3 checks passed
bmc08gt added a commit that referenced this pull request Oct 7, 2026
…e-token-card

* origin/code/cash:
  build: update release manifest
  fix(chat): run the emoji drawability check on the injected dispatcher (#1719)
  test(profile): stub the cover prefetch in the featured groups picker test (#1718)
  chore(contacts): drop the READ_CONTACTS permission (#1717)
  fix(chat): drop the empty band above the oldest message (#1716)
  fix(profile): let content show through behind the footer buttons (#1715)
  feat(chat): drop the card at the start of chat history (#1707)
  feat(ui): blur scroll content under the app bar on more screens (#1713)
  fix(profile): open looked-up people and featured groups on their profiles (#1709)
  fix(profile): let content scroll under the pinned bar (#1706)
  feat(chat): only members who can chat collect cash links (#1714)
  fix(tipping): floor group minimum balance at one cent (#1712)
  feat(profile): link a chat's token from its profile (#1708)
  fix(tokens): load the market cap explainer for tokens you don't hold (#1710)

# Conflicts:
#	apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/screens/profile/GroupProfileScreen.kt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant