Skip to content

Fix eight bugs the new tests found, and order the first import usefully - #129

Merged
wanderdev0 merged 3 commits into
mainfrom
fix/1.1.0-bugs-and-coverage
Aug 22, 2026
Merged

wanderdev0 merged 3 commits into
mainfrom
fix/1.1.0-bugs-and-coverage

Conversation

@wanderdev0

Copy link
Copy Markdown
Owner

Eight user-visible bugs, one performance change, and the coverage that found them.

Every bug here was found by writing a test for behaviour that was assumed to work, not by
looking for bugs. That is the argument for the second commit being as large as it is.

The fixes

History discarded reports it already had getReportsForDay merged the local database with Apple's answer only for days older than a week. Inside the week it took the remote answer alone — and Apple returning nothing for a window is ordinary, so a tag the map had located minutes earlier showed an empty history. Stepping back a day and returning made it reappear, which is how @parawanderer originally reported it
Navigate-to was dead on every Android 11+ device it named com.google.android.apps.maps, and package visibility hides a package the manifest has not declared — so resolveActivity returned null with or without Google Maps installed, and the button silently logged
The iCloud screen could not be left back was swallowed for the whole loading step, which is right for an unlock in flight and wrong for everything else — and PythonLock serialises that screen behind the location fetch, which a first import holds for minutes. It also claimed to be "looking for a device that can unlock it" before knowing whether one was needed, which for a linked account it never is
Settings crashed on a session with no account details chained through getAccount().getInfo(). That is the screen with the sign-out button on it
The app's own escrow record was offered as an unlock option joining the trust circle registers this app as a device, so the picker asked for the screen-lock passcode of a device with no screen and no lock
Menu actions offered with nothing selected read the empty selection and returned — tappable, did nothing, said nothing
Export Logs untranslated it sat in English in a menu of translated items. The debug_* field labels stay English deliberately, so a pasted bug report stays readable
Permanent warning triangles on rows whose text already said the same thing, and permanent for anyone with Apple hardware on their account

Plus: the Information page shows the themed app mark rather than a large empty middle.

First import, ordered by what the export already knows

ScanOrder shuffled every never-scanned tag, reasoning that nothing is known about them. Nothing
is known about their scans — but the bundle records when macOS last observed each one, and that
predicts what the first fetch costs: a recent record is a request or two, an old one is a walk
through tens of thousands of key indices.

It matters most exactly where the app is slowest, since a first import gives every tag the full
seven-day window. Tags with no alignment record go last and stay shuffled among themselves, so
none is permanently the one that never gets reached.

Coverage

Roughly sixty tests. Two screens had none at all: HistoryViewActivity (its Apple session
comes from a singleton only the map sets up, so nothing could launch it) and InformationActivity.

  • AMapWithTagsOnIt — the fixture behind seven of these, so the eight-step arrangement to reach a
    drawn map exists once rather than seven times
  • FakeMapView, FakeGeocoder, AddressLookup — for what the managed device cannot provide.
    aosp-atd has no geocoding backend, and the app's fallback for "no address" is to print
    coordinates, so a missing geocoder was indistinguishable from an honest answer
  • CoordinateConverterTest — JVM, and the only coverage the AMap path has (see The real map providers have no tests, and adding one is an advertised extension point #127)
  • espresso-contrib excludes protobuf-lite, which otherwise breaks every Cronet-touching test
    with a failure naming protobuf and Chromium and nothing about the test

Full suite: 543 tests, 9m 31s, green. Up from 493.

Not in this PR


🤖 Written by Claude Code

wanderdev0 and others added 3 commits August 21, 2026 22:01
Every one of these was found by writing a test for behaviour that was
assumed to work, rather than by looking for bugs. All are user-visible.

**History threw away reports it already had.** getReportsForDay merged the
local database with Apple's answer only for days *older* than a week, on the
reasoning that Apple stops serving history beyond seven days. Inside the week
it took the remote answer alone. Apple returning nothing for a window is
ordinary - reports age out, and a narrow key window covers less than the day
asked for - so a tag the map had located minutes earlier showed an empty
history, and stepping back a day and returning made it reappear. It now
merges for every day; combineAndSort already de-duplicates.

**Navigate-to was dead on every Android 11+ device.** It named
com.google.android.apps.maps explicitly, and package visibility hides a
package the manifest has not declared - so resolveActivity returned null with
or without Google Maps installed, and the button logged and did nothing. The
manifest now declares the geo: intent, no package is named, and a phone with
no maps application is told so instead of nothing happening.

**The iCloud screen could not be left.** Back was swallowed whenever the
loading step was up, which is right for an unlock in flight against Apple and
wrong for everything else - and PythonLock serialises the iCloud flow behind
the location fetch, which a first import holds for minutes. It also said
"Looking for a device that can unlock it" before knowing whether a device was
needed at all, which for an already-linked account it never is.

**Settings crashed on a session with no account details**, chaining through
getAccount().getInfo(). That is the screen with the sign-out button on it, so
it is exactly where somebody with a broken session needs to get to.

**The app's own escrow record was offered as something to unlock with.**
Joining the trust circle registers this app as a device, and the picker then
asked for the screen-lock passcode of a device with no screen and no lock.
Filtered on APP_IDENTITY.serial rather than a literal, so there is still one
source of truth for the identity.

**Menu actions were offered with nothing selected**, read the empty selection
and returned - a tappable item that did nothing and said nothing.

Also: Export Logs and its two toasts are translated (they sat untranslated in
a menu of translated items; the debug_* field labels stay English so a pasted
bug report is readable), the permanent warning triangles are gone from rows
whose text already says the same thing, and the Information page shows the
themed app mark instead of a large empty middle.

**And the first import is ordered by what the export knows.** ScanOrder used
to shuffle every never-scanned tag, on the reasoning that nothing is known
about them. Nothing is known about their *scans*; the bundle knows when macOS
last observed each one, and that predicts what the first fetch costs - a
recent record is a request or two, an old one is a walk through tens of
thousands of key indices. It matters most exactly where the app is slowest,
because a first import gives every tag the full seven-day window. Tags with
no alignment record go last and stay shuffled among themselves, so none is
permanently the one that never gets reached.

Co-Authored-By: Claude Opus 5 <[email protected]>
Around sixty tests, and the fixtures without which most of them could not
exist. Every bug in the commit before this was found by writing one of these.

**Screens that had no tests at all.** HistoryViewActivity had none - it takes
its Apple session from PythonAppleService.getInstance(), a singleton only the
map sets up, so nothing could launch it without launching the map first, and
nothing did. InformationActivity had none either.

**AMapWithTagsOnIt** is the fixture behind seven of these. Reaching a drawn
map takes eight steps - a stored session, the Python double, a substituted
provider, a geocoder, beacons with usable accessory_json, locations to draw
them at, an Anisette mode recorded so the upgrade dialog does not open over
the screen, and RefreshPolicy.resetShared() so the startup fetch is not
skipped. A copy of that which forgets the last step passes for a year,
because the fetch it meant to observe never ran.

**Three fakes for what the managed device cannot provide.** FakeMapView draws
the recorded markers so a screenshot shows something, captioned as a fake so
nobody mistakes one for evidence about a real place. FakeGeocoder answers
lookups the aosp-atd image cannot: it has no geocoding backend, and the app's
fallback for "no address" is to print coordinates, so a missing geocoder was
indistinguishable from an honest answer. AddressLookup is an interface rather
than a Geocoder subclass because Geocoder is final.

**apple_test_double** gained the ranged fetch path. getReports generates the
day's keys itself rather than asking for a location, so a double without
keys_between made every history fetch look like a genuinely empty day - the
shape of the bug that path exists to fix, arriving from the test double.

**CoordinateConverterTest runs on the JVM** and is the only coverage the AMap
path has: both real providers need a device this project cannot provision, so
everything else runs against the fake. The conversion is the one piece that
is pure arithmetic, and a wrong one puts every pin a few hundred metres out
for every user in mainland China, silently.

**espresso-contrib excludes protobuf-lite**, and without that it breaks tests
it has nothing to do with. It pulls protobuf-lite 3.0.1, which predates the
method Cronet calls while deciding whether to use the HTTP engine - so
anything building a CronetEngine dies with NoSuchMethodError, which in this
app is the Anisette server tester that SettingsActivity constructs. Adding
the dependency stopped every Settings test running, with a failure naming
protobuf and Chromium and nothing about the test.

Also a stub activity in the debug manifest that claims to open geo: links, so
the navigate-to path can be tested at all - aosp-atd ships no maps
application, and that activity is visible to the app only because of the
geo: <queries> entry, so deleting the entry turns the test red.

Co-Authored-By: Claude Opus 5 <[email protected]>
AGENTS.md said `testDebugUnitTest` was "close to meaningless: there is
exactly one JVM test and it asserts 2 + 2 == 4". There are now 118 of them
and they run in about ten seconds - refresh policy, scan order, marker focus,
the long-fetch banner, passcode parsing, the CSV and zip writers, coordinate
conversion. That is the fast loop, and worth running constantly. The real
caveat stands and is kept: every screen, every repository and the whole
Python bridge are instrumented, so a green JVM run still says nothing about
them.

CONTRIBUTING gains the same count, plus the three Java-side fakes and the
fixture in the test table - rule 10, which asks that anything listing things
rather than describing them gets updated in the same change. It also notes
that CoordinateConverterTest is the only AMap coverage that exists and why,
so nobody mistakes the fake for the provider.

Co-Authored-By: Claude Opus 5 <[email protected]>
@wanderdev0
wanderdev0 merged commit 7454ca5 into main Aug 22, 2026
4 of 5 checks passed
wanderdev0 added a commit that referenced this pull request Aug 22, 2026
…ailed"

A run on #129 died part-way: 362 of 543 tests, then "Instrumentation run
failed due to Process crashed". It was reported as two failing tests, and
those two names were whichever happened to be in flight - arbitrary, nothing
to do with the cause, and treated as clues for a while before the count was
noticed. The other 181 never ran, which the summary does not mention at all.

Two changes, both diagnostic. Neither tries to fix the crash: it did not
reproduce locally across a full 548-test run, and a change guessing at
emulator memory or sharding would be a fix with no evidence behind it.

**The logcat is kept.** The job already uploaded reports/androidTests/, which
is HTML summaries - useful for reading an assertion, useless for a process
that died. The logcat lives in outputs/androidTest-results/ and was being
discarded, so a CI-only crash could be seen and never explained. It costs
nothing on a green run.

**And the completed count is checked.** The last "Tests N/M completed" line
carries both numbers; if N is short of M the step fails saying so, rather
than leaving a reader to work out that a two-failure summary was really a
suite that stopped. Verified against the real logs from both runs of #129 -
the aborted one and the one that finished.

Note the check is deliberately lenient where it cannot be sure: no counts in
the log means it defers to Gradle rather than inventing a verdict.

Co-Authored-By: Claude Opus 5 <[email protected]>
saamdotexe pushed a commit to saamdotexe/OpenTagViewer that referenced this pull request Oct 22, 2026
…d-coverage

Fix eight bugs the new tests found, and order the first import usefully
saamdotexe pushed a commit to saamdotexe/OpenTagViewer that referenced this pull request Oct 22, 2026
…ailed"

A run on wanderdev0#129 died part-way: 362 of 543 tests, then "Instrumentation run
failed due to Process crashed". It was reported as two failing tests, and
those two names were whichever happened to be in flight - arbitrary, nothing
to do with the cause, and treated as clues for a while before the count was
noticed. The other 181 never ran, which the summary does not mention at all.

Two changes, both diagnostic. Neither tries to fix the crash: it did not
reproduce locally across a full 548-test run, and a change guessing at
emulator memory or sharding would be a fix with no evidence behind it.

**The logcat is kept.** The job already uploaded reports/androidTests/, which
is HTML summaries - useful for reading an assertion, useless for a process
that died. The logcat lives in outputs/androidTest-results/ and was being
discarded, so a CI-only crash could be seen and never explained. It costs
nothing on a green run.

**And the completed count is checked.** The last "Tests N/M completed" line
carries both numbers; if N is short of M the step fails saying so, rather
than leaving a reader to work out that a two-failure summary was really a
suite that stopped. Verified against the real logs from both runs of wanderdev0#129 -
the aborted one and the one that finished.

Note the check is deliberately lenient where it cannot be sure: no counts in
the log means it defers to Gradle rather than inventing a verdict.

Co-Authored-By: Claude Opus 5 <[email protected]>

This branch was previously deployed

1 inactive deployment
Android Build — 44ff1b8e Deployed Aug 21, 2026 by wanderdev0 via Instrumented tests (emulator) #139
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