Repository navigation
fix(tip): round a converted DM fee floor up - #889
Merged
Merged
Conversation
This was referenced Sep 28, 2026
bmc08gt
added this pull request to stack #894
September 28, 2026 18:43
The Start Chatting sheet submits the floor TipFloor.toOpenDM states, and that floor rounded the converted fee to the nearest cent. A 600 INR fee at 95.95 INR/USD is $6.2533, stated as $6.25, which is 599.69 INR. The client accepted it and the server denied it (Bugsnag 6a67781). converted(to:rates:) takes a roundingUp flag and toOpenDM is the only caller that sets it, so display conversions still round half-up. A fee that converts exactly is unchanged.
bmc08gt
force-pushed
the
fix/tip-floor-rounding
branch
from
September 28, 2026 18:44
52dd82b to
dde9c26
Compare
bmc08gt
added a commit
that referenced
this pull request
Oct 1, 2026
`let floor = try #require(floor(for: ...))` resolves `floor` to the local being declared once #require expands, so Xcode 26.3 fails with "cannot call value of non-function type 'TipFloor'". That broke App vectors (build) in the vector gate on every run since #889. Rename the helper to statedFloor(for:).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes Bugsnag
6a67781: "tip below the recipient's chat initialization fee", 117 events from 22 users, still firing on 2026.9.1 and 2026.9.2.TipFloor.toOpenDMconverts the recipient's fee into the sender's currency, andconverted(to:rates:)rounds that to the nearest cent. The Start Chatting sheet submits exactly that floor. When the conversion lands under the half cent, the floor comes out below the fee: 600 INR at 95.95 INR/USD is $6.2533, stated as $6.25, which is 599.69 INR. The client check passes because it compares against the same rounded figure, and the server denies the tip.converted(to:rates:)now takes aroundingUpflag, backed byFiatAmount.ceiledToSmallestUnit()andDecimal.roundedUp(to:).toOpenDMis the only caller that sets it, so display conversions still round half-up. A fee that converts exactly is unchanged.Regression_6a677815fdca5cb0d6a9ef7ecovers the INR case above, an entry of $6.25 no longer clearing that floor, a 1500 NGN fee at 1326 NGN/USD, and an exact conversion that stays at $6.00.Android has the same rounding in
TipPaymentDelegate.inCurrency; the fix is code-payments/code-android-app#1597.A second path to a similar denial is still open on both platforms:
toOpenDMnever checks the recipient's fee against the regional tip-preset minimum.