Skip to content

fix: 2.2.1, crashes on text selection and vault lock; publish to Google Play from CI - #74

Merged
pasichDev merged 4 commits into
mainfrom
fix/text-selection-clipboard-crash
Oct 18, 2026
Merged

pasichDev merged 4 commits into
mainfrom
fix/text-selection-clipboard-crash

Conversation

@pasichDev

@pasichDev pasichDev commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

✅ Ready: merge once CI is green.

Before tagging v2.2.1: the one-time Google Cloud / Play Console / google-play environment setup for CI publishing. Without it the tag still makes the GitHub Release and the Play upload is skipped (kill switch).

What

Hotfix 2.2.1 for the two crashes reported on 2.2.0, plus publishing to Google Play from CI.

  • Crash on text selection. Double-tapping a word (any text selection) crashed the app. SensitiveClipboard now implements AndroidClipboard. The Compose 1.12 text toolbar reads the system clipboard through Clipboard.nativeClipboardManager, and that call throws for any other Clipboard. Copies are still marked sensitive and still cleared after a minute.
  • Crash when the vault locks. The drawer counts (StatisticViewModel) and the Tasks list (TasksViewModel) collected database flows without error handling. Once the vault session closed, a re-query threw Database session expired. The failure is now logged and the last values stay on screen until the lock screen takes over.
  • Play publishing. A vX.Y.Z tag builds the play bundle, signs it and publishes it to production at 100%. The upload includes mapping.txt and the store release notes.
  • Release 2.2.1. version.properties, CHANGELOG.md and the release notes in all nine store languages.

Why

On 2.2.0 every crash in Play Console comes from these two causes:

  • IllegalArgumentException in AndroidClipboard_androidKt.getNativeClipboardManager, from the text toolbar.
  • IllegalStateException in SecureDatabaseManager.getDatabase, from the tags and tasks flows. Its 2.1.0 groups are the same two collectors.

Releases reached Play by hand and without a mapping file, so 2.2.0 crash reports were obfuscated.

Behaviour changes

  • Pushing a v* tag now publishes to Google Play production for 100% of users. There is no approval step. PLAY_PUBLISH_ENABLED is the only switch.
  • publish-play.yml no longer takes a ref or status input. To re-run it, start it by hand from the tag.

Deploy

How CI talks to Google: no Google key is stored in GitHub.

  • The upload job exchanges the run's OIDC token for a short-lived service-account token through Workload Identity Federation.
  • The provider accepts only this repository (by its numeric id), the google-play environment and refs/tags/v*.
  • The service account has no Google Cloud roles, only release rights for Encly in Play Console.
  • The build job holds the signing key and has no OIDC token. The upload job has the OIDC token and only gets the signed bundle.

Repository variables needed: PLAY_WIF_PROVIDER, PLAY_SERVICE_ACCOUNT, PLAY_PUBLISH_ENABLED=true, plus the environment google-play with a deployment rule for v* tags. The old PLAY_SERVICE_ACCOUNT_JSON secret is no longer used.

Testing

  • New regression tests:
    • SensitiveClipTest (the system clipboard is still reachable under the boundary).
    • StatisticViewModelTest and TasksViewModelTest (a read failing after the vault closed).
    • All three fail without the fixes and pass with them.
  • StoreMetadataTest now checks:
    • the publish workflow's triggers (v* tags and manual only);
    • the kill switch on every job;
    • that no job has both the signing secrets and id-token: write.
  • testPlayDebugUnitTest and testFdroidDebugUnitTest: 1704 tests each, 0 failures. lintPlayRelease and lintFdroidRelease pass. bundlePlayRelease builds and writes mapping.txt.
  • The crash stack traces were retraced with the 2.2.0 playRelease mapping.

Not verified:

  • On a device: text selection and locking with the Tasks screen open.
  • detekt locally (only JDK 25 installed; CI runs it).
  • The first end-to-end Play upload through Workload Identity Federation. r0adkll/upload-google-play reads the credentials file through GOOGLE_APPLICATION_CREDENTIALS with google-auth-library 9, which supports external_account, but only the first tag run proves it.

Selecting text (for example double-tapping a word) crashed the app on
2.2.0. The text toolbar of Compose 1.12 reads the system clipboard
through Clipboard.nativeClipboardManager, which throws for any
Clipboard that is not an AndroidClipboard, and SensitiveClipboard was
a plain Clipboard. It now implements AndroidClipboard; copies are still
marked sensitive and cleared after a minute.
The drawer counts and the Tasks list collected database flows with no
error handling. When the vault locked, the session closed before the
lock event cancelled them, Room re-queried, getDatabase threw
"Database session expired" and the app crashed. Such a failure is now
logged and the last values stay until the lock screen takes over.
…mapping

A vX.Y.Z tag now builds, signs and uploads the play bundle to the
production track at 100%, with mapping.txt and the store release notes.
Google access uses Workload Identity Federation, so no Google key is
stored in GitHub. The build job holds the signing key without an OIDC
token; the upload job runs in the google-play environment with the OIDC
token and only the signed bundle. PLAY_PUBLISH_ENABLED stays the kill
switch, and the store test now checks the triggers, the guard and that
no job holds both secrets.
Bumps the version to 2.2.1 (versionCode 20201), adds the 2.2.1 section
to the changelog and the store release notes in all nine store
languages.
@pasichDev pasichDev self-assigned this Oct 18, 2026
@pasichDev
pasichDev marked this pull request as ready for review October 18, 2026 21:00
@github-actions

Copy link
Copy Markdown

Coverage

Overall Project 89.76% 🍏
Files changed 100% 🍏

File Coverage
StatisticViewModel.kt 100% 🍏
TasksViewModel.kt 94.58% 🍏
SensitiveClip.kt 88.76% 🍏

@pasichDev
pasichDev merged commit 0916d69 into main Oct 18, 2026
1 check passed
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.

1 participant