Skip to content

test(sync): make a LAN scanner after the mailbox fail when a code is served again - #1849

Open
A-EDev wants to merge 1 commit into
mainfrom
test/sync2-lan-after-mailbox
Open

A-EDev wants to merge 1 commit into
mainfrom
test/sync2-lan-after-mailbox

Conversation

@A-EDev

@A-EDev A-EDev commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

a_scanner_on_the_lan_gets_nothing_after_the_mailbox_was_answered still passed when a code was revealed and served again after a failed attempt. A retried attempt found the first scanner's message still in the mailbox, so it went back to the mailbox and never reached the LAN scanner.

The test now uses a mailbox that hands each message out once, so a shower that starts over could only serve someone else. It also requires the LAN connection to exist, where before a failed dial passed too.

Related issue

None.

Change type

  • Bug fix
  • Feature
  • Refactor or maintenance
  • Build, packaging, or CI
  • Documentation

Tests only. No nightly note.

Validation

All Gradle commands ran with --offline -Dorg.gradle.jvmargs="-Xmx4096m -XX:MaxMetaspaceSize=1024m -Dfile.encoding=UTF-8 -Djava.net.preferIPv6Addresses=true".

The mutation, not committed: Offer.reveal doesn't refuse a second reveal, Listening.accept doesn't cancel its connections, and addDevice retries after a failed attempt, up to 200 times.

Run Result
Old test, no mutation LanPairingTest 11 of 11 passed
Old test, with the mutation it passed; a_second_scanner_on_the_lan_gets_nothing_while_the_first_pairs, run with it as a control, failed
New test, with the mutation failed: the code is finished expected null, but was:<[B@...>, so the LAN scanner got the key
New test, no mutation LanPairingTest 11 of 11 passed
  • :app:testGithubDebugUnitTest --tests 'io.github.aedev.flow.sync2.*': 301 tests, 0 failed.

  • ktlintCheck: exit 0.

  • ./gradlew :app:assembleGithubDebug: not run locally, CI builds it.

  • ./gradlew :app:testGithubDebugUnitTest: full suite not run locally, CI runs it.

  • I ran any additional flavor-specific build or test tasks affected by this change.

  • I manually tested the affected behavior on an Android device or emulator: not applicable, tests only.

Test device and Android version: none.

Risk and compatibility

Tests only.

  • The change does not introduce secrets, private data, or unexpected telemetry.
  • New user-facing text uses Android string resources. (None added.)
  • Dependency and lockfile changes are intentional and limited to this PR.
  • Room schema changes include the required version bump and migration, or this PR does not change the Room schema.
  • Breaking changes and upgrade steps are clearly documented. (None.)

Copilot AI balanced review requested due to automatic review settings November 7, 2026 18:30

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

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.

2 participants