Repository navigation
Conversation
…Android bulwarkmail#147 When a new mail's subject or preview carries a sign-in code (two-factor, verification, one-time password), its notification shows "Copy 482913" as the first action, in place of Reply: the tray shows three actions, and nobody answers a code mail. Tapping it copies the code, marked sensitive so the clipboard preview of Android 13+ hides it, and dismisses the notification; below Android 13 a toast says it was copied. A number only counts near a word that names a code (in the app's languages), after it, or before it only where it leads a line. It does not count where that word names something else (promo, gift card, postal, error or decline code, barcode), where the number is what the code is for (card ending in, account, issue, shipment, flight), for a phone or dial-in number, or in mail that sells something or invites to a meeting. Offering a wrong number is worse than offering none. Both the native lookup and the JS task end in postNotification, so both get it; a login whose organisation hides notification content shows no content and so no code. The label is new in every locale (machine translated); the toast reuses notifications.copied_to_clipboard.
wmcparla
marked this pull request as ready for review
November 15, 2026 15:59
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.
Summary
When a new mail's subject or preview carries a sign-in code (two-factor, verification, one-time password), its Android notification offers Copy 482913 as its first action, in place of Reply (#147). Tapping it copies the code and dismisses the notification. Mail without a code keeps Mark as read, Delete and Reply as today.
Android 13+ shows the copied code masked in its clipboard preview, because the clip is marked sensitive.
Changes
OtpCode.kt, new): searches the subject and the server's preview. Offering a wrong number is treated as worse than offering none, so it errs towards none.#123456;BulwarkFcmModule.postNotification):runCatching: a fault in it can't cost the notification.BulwarkNotificationActionReceiver):android.content.extra.IS_SENSITIVE, labelled with the app's name rather than the code.copyCodeLabelis absent.notifications.copy_code("Copy {code}") is new in everylocales/rn/<lang>.json, machine-translated. Android puts the code in place of{code}.notifications.copied_to_clipboard.showNotificationoptions and the sharedstringsof the native lookup), with English fallbacks instrings.xml.Related issues
Closes #147
Type of change
Checklist
npm run typecheckand there are no errors (native has nolintscript)npm run buildin native; an x86_64 release APK,assembleGithubRelease -PallowDebugSignedRelease=true, builds and runs)locales/) if my changes affect user-facing text (machine-translated;npm run i18n:checkpasses)Tests:
npx vitest run: 7103 passed, 163 skipped (the live Stalwart suites).npx tsc --noEmitandnpm run i18n:checkare clean../gradlew :app:testGithubReleaseUnitTest: every suite passes, including the newOtpCodeTest(22 tests). It covers:Beyond the unit tests, a separate review ran 74 realistic mails through the detector:
69 came out as expected. Left as they are:
G-482913, which isn't offered;On a device (Android 16 emulator, x86_64 release build, test accounts on a self-hosted Stalwart, mail delivered over SMTP and pushed through FCM and the hosted relay):
Not tested:
{code}.🤖 Generated with Claude Code