Skip to content

fix: usdt over-50% warning names the usdt balance - #1069

Merged
ovitrif merged 3 commits into
masterfrom
fix/usdt-over-50-warning-copy
Oct 21, 2026
Merged

ovitrif merged 3 commits into
masterfrom
fix/usdt-over-50-warning-copy

Conversation

@ovitrif

@ovitrif ovitrif commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Twin: synonymdev/bitkit-android#1644
Refs: #1057

Description

Out of Scope

Design

N/A — no design available.

Preview

The warning is forced open on the USDT screen with a local debug hook, since the check needs a funded USDT wallet; the dialog and its strings are the real ones. Status bar clock masked.

Before After

QA Notes

Journeys

N/A

Manual Tests

  • USDT send of more than half the USDT balance → swipe → alert reads "…over 50% of your USDT balance…" — needs a funded USDT wallet (local USDT fixture)
  • Bitcoin send of more than half the total balance → alert still reads "…over 50% of your total balance…"

Automated Checks

  • ran validate-translations.js

@ovitrif ovitrif added this to the 3.1.0 milestone Oct 21, 2026
@ovitrif ovitrif self-assigned this Oct 21, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T00:37:05.826877Z 94d40de PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

The USDT over-50% warning now names the USDT balance.

  • USDT send warnings name the balance being checked.

No actionable issues found. Static review only; the iOS alert was not run.

Acknowledgment: ovitrif explicitly deferred the completed swipe knob behavior to #1064 and broader balance-warning product decisions to separate work.

Reviews (1) · Last reviewed commit: "fix: usdt over-50% warning names the usd..." · Reviewed by Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 94d40de047

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Bitkit/Views/Wallets/UsdtSendView.swift

@talosmachina talosmachina left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No findings. USDT sends over half the USDT balance now show a USDT-specific warning on a new key, wallet__send_dialog2_usdt, so the bitcoin send path keeps wallet__send_dialog2. Reviewed 4a49042, full tier, reasoned from the code (iOS does not build on this reviewer's Linux host).

What I checked, and 3 candidates I ruled out

Read in full: Bitkit/Views/Wallets/UsdtSendView.swift (confirmPayment and the warning alert), the 15 Localizable.strings hunks
Call sites traced: every send_dialog2 reference in Swift. UsdtSendView.swift:705 is the only USDT site, and SendConfirmationView.swift:205 (.balance) still maps the bitcoin path to the unchanged key
Ran: node scripts/validate-translations.js on the head, which reports 0 errors
CI: SwiftFormat, validate and detect-changes green; Run Tests, Run Integration Tests and build-local still pending at review time

Ruled out

  • Alert shows the raw key in some locale: all 15 .lproj directories gain the key, and the validator agrees.
  • Re-asking an already confirmed warning: confirmedWarnings stores the key string that confirmPayment appends, and both sides use the new key, so a confirmed USDT warning is skipped on the second pass the same way the old key was.
  • Bitcoin copy regression: no Swift site other than UsdtSendView was changed, and the bitcoin message still comes from wallet__send_dialog2.

Merge confidence: 4/5, a copy change with no findings, but the test and build jobs had not finished at review time.

@ovitrif
ovitrif requested review from a team, coreyphillips and pwltr and removed request for a team October 21, 2026 00:57
@ovitrif

ovitrif commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed f69b078: adds the USDT over-50% warning to the manual checklist in Docs/USDT-QA.md, matching synonymdev/bitkit-android#1644. No code change. The failed Run Tests job (SendConfirmationLifecycleTests.testPendingWalletSwitchResumesAfterTags) does not touch this change and passes on master; I reran it.

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code scan at f69b078: no issues found.

  • Right balance: the warning compares the quote amount with the USDT wallet balance only, so naming the USDT balance is accurate.
  • No math change: the check uses the amount without the fee, the same as master. Fee checks are separate warnings.
  • Bitcoin path unchanged: it still uses its own total-balance text.
  • Confirmed warnings: accepting once skips the warning on the next confirm, and Cancel behaves as on master.
  • E2E: the alert keeps SendDialog2, and the English text still contains "over 50%".
  • Translations: the new key is in every locale, and the alert wraps with no fixed-width container.
  • Parity: matches synonymdev/bitkit-android#1644.

Device gate (partial): f69b078 — not run yet. Pending:

  • on the USDT fixture, send more than half the USDT balance and check the alert names the USDT balance;
  • a bitcoin send over half the total, which should keep the total-balance text;
  • one long locale (de or ru).

Device results will follow in a separate review.

@jvsena42 jvsena42 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Device gate passed on the USDT fixture (iPhone 17 simulator). Approving; my earlier code scan found no issues.

  1. USDT send of 13.00 out of 25.00: the alert reads "over 50% of your USDT balance", with Cancel and Yes, Send.
  2. Cancel: the alert closes, the knob goes back to the start and nothing is sent. Swiping again shows the alert again.
  3. Yes, Send opens PIN. After backing out of PIN, a second swipe goes straight to PIN with no second alert. One send of 13.00 went through.
  4. Bitcoin send of 500,000 and 400,000 out of 763,054 sats via Paste: the alert keeps "over 50% of your total balance".
  5. German: the text wraps onto three lines and nothing is clipped.

iOS has no SendDialog2 identifier, because the alert is a system alert. The e2e helper matches it by its "over 50%" text, which is still there.

Out of scope, not from this PR: when a second bitcoin: URI opens while the Send sheet is already on Amount, the amount resets to 0. Typing 400,000 sats and swiping then goes straight to PIN with no 50% warning. The same amount via Paste does warn. Repro: run xcrun simctl openurl <udid> "bitcoin:<addr>?amount=0.005" twice, type 400000, Continue, swipe. I'll raise it as a separate issue.

Device gate: f69b078 — 5 checks passed, 0 failed (USDT alert, Cancel, Accept, bitcoin alert, de); l10n: de fits; Android: passed on synonymdev/bitkit-android#1644.

@ovitrif
ovitrif merged commit 52da686 into master Oct 21, 2026
19 of 21 checks passed
@ovitrif
ovitrif deleted the fix/usdt-over-50-warning-copy branch October 21, 2026 12:45
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.

bug: swipe to pay snaps back after the high-share warning on usdt sends

3 participants