Skip to content

test(android): await git commit success callback - #560

Merged
Codename-11 merged 2 commits into
Codename-11:devfrom
JackHunzicker:contrib/git-state-callback-test-order
Sep 9, 2026
Merged

Codename-11 merged 2 commits into
Codename-11:devfrom
JackHunzicker:contrib/git-state-callback-test-order

Conversation

@JackHunzicker

@JackHunzicker JackHunzicker commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix a race in the Android Git-state commit-success callback test. The test treated mutation success publication as proof that its callback had already run, although the ViewModel refreshes repository details before invoking the callback.

This is an independent test-only fix; it is not part of the hosted-room feature in #559.

Changes

  • Capture the callback's GitTarget in a CompletableDeferred and await delivery with a bounded timeout.
  • Preserve the successful mutation-state observation and alpha repository assertion.
  • Leave production behavior, response ordering, and the separate failure-callback test unchanged. No sleeps, retries, skipped tests, or timeout increases.

Verification

Baseline: df0fe59b0b11b5b1646b62b9d2c23ef791194984 (freshly fetched origin/dev).
Verified patch: bb23e6ab483316b24931cfc3a9edc69197691a18. Its required hosted checks passed, including Android tests, lint and build. Local test scope is recorded below.

All Android commands used the Windows machine-wide lane and the installed Android SDK, with ANDROID_HOME and ANDROID_SDK_ROOT set.

powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/android-lane.ps1 gradle :app:testSideloadDebugUnitTest --tests '*GitStateWriteViewModelTest.commit success callback fires only after successful response' --console=plain
  • Unmodified baseline: 1 test / 1 failure, expected:<alpha> but was:<null> at the callback assertion.
  • Fixed tree: 1 test / 0 failures.
powershell.exe -NoProfile -ExecutionPolicy Bypass -File scripts/android-lane.ps1 gradle :app:testSideloadDebugUnitTest --tests '*GitState*ViewModelTest' :app:testGoogleplayDebugUnitTest --tests '*GitState*ViewModelTest' --console=plain
  • Both Gradle test tasks executed successfully on the committed patch; the Google Play task resolves to :app:testGooglePlayDebugUnitTest.
  • 66 tests passed, 0 failures/errors/skips: 33 each for sideload and Google Play, covering GitStateViewModelTest, GitStateWriteViewModelTest, and GitStateExtrasViewModelTest.
  • Independent diff review and git diff --check passed.
  • Full Android lint, unrelated test shards, assemblies, and device/emulator testing were not run: this changes only synchronization inside a JVM unit test, not application/UI code. Existing compiler/deprecation warnings remain unchanged.

Screenshots

No visual change.

Compatibility / risk

Test-only. No upstream API, production behavior, storage, security/privacy, translation, server/plugin, desktop, or documentation changes. No migration or rollout required. Changelog: N/A, no user-visible change.

Lineage / contributor credit

Checklist

  • Target branch is dev, unless this is a dev → main release PR or a focused production-tag hotfix PR to main
  • Scope is focused and related issues/PRs are linked
  • Android changes: lint and focused tests ran, or rationale is listed above
  • Translation changes: locale validation/review ran, or N/A is listed above
  • Server/plugin changes: focused tests ran, or N/A/rationale is listed above
  • Desktop changes: build/tests ran, or N/A/rationale is listed above
  • Docs/site changes: build or link/route checks ran, or N/A/rationale is listed above
  • UI changes were tested on a relevant device/emulator/desktop surface, or the missing proof is stated above
  • Commit messages follow Conventional Commits
  • CHANGELOG.md is updated for user-visible changes, or N/A is listed above
  • Public writing hygiene checked: no secrets, private infrastructure, personal names, or AI/process narration
  • Salvaged/replacement work links source PRs and preserves contributor authorship, or N/A is listed above

Mutation success is published before detail refresh finishes and the callback runs. Await callback delivery explicitly instead of treating the state flow as a callback-completion barrier.

Signed-off-by: Jack <JLHunzicker@gmail.com>
@hermes-relay-triage hermes-relay-triage Bot added the area:android Kotlin app label Sep 8, 2026
@hermes-relay-triage

Copy link
Copy Markdown

🤖 Hermes-Relay automated PR intake

Thanks for the focused Android test fix! The PR targets dev, includes every template section, links #559 for context, and provides exact focused test commands and results plus rationale for the checks that were not run. CI is currently pending.

A maintainer will review the implementation and CI results.

@Codename-11

Copy link
Copy Markdown
Owner

Hey @JackHunzicker, appreciate the PR - and the interest in the project 😁 This looks good! Thanks for splitting this out from #559 as well. Merging now!

@Codename-11
Codename-11 merged commit c902215 into Codename-11:dev Sep 9, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:android Kotlin app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants