Skip to content

cmh: keep the image rows when location_view cannot be queried (Android 16) - #1779

Merged
abrignoni merged 5 commits into
abrignoni:mainfrom
danjethh:fix/cmh-android16-no-location-table
Oct 25, 2026
Merged

abrignoni merged 5 commits into
abrignoni:mainfrom
danjethh:fix/cmh-android16-no-location-table

Conversation

@danjethh

@danjethh danjethh commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

Fixes the Samsung cmh.db (Media/Gallery) artifact on Android 16. On the One UI 8 database tested, location_view is still in the schema but the location table it selects from is gone, so the Address join failed with no such table: main.location and the artifact reported no rows for a database holding 213 image rows. The artifact now tests the view first and, when it cannot be queried, reports the files rows with Address blank. The notes say what a blank Address means and what was observed.

For a new or changed artifact

  • Ran the tool against real extractions and confirmed the row counts: four Android 16 (One UI 8) Samsung full file system extractions (two S-series and two A-series phones). The artifact returns 5,523 / 215 / 4,582 / 1,450 rows; upstream main returns 0 / 0 / 0 / 3. An independent SELECT count(*) FROM files WHERE media_type = 1 on each user's cmh.db (no ALEAPP code) gives 5,523 / 213 + 2 / 4,561 + 21 / 1,447 + 3, equal.
  • Ran check_artifact_output.py on the four full reports and fixed or documented every finding. The first run on device 1 reported Date Added, Date Modified, Title and Bucket Name empty on all 5,523 rows; they are NULL in the files table (count 0), and the notes now say so. All four reports then give "nothing to look at".
  • Checked against a second app data directory: the Secure Folder user's cmh.db is read beside the owner's on all four extractions (the +2, +21 and +3 rows above). --compare on a tree holding the same cmh.db twice, a second user and a decoy reads 1x (213 then 213), because the artifact parses byte-identical copies once; that is the recorded known failure for the two new cases, not a dropped user (a real second user's database differs, as the counts show).
  • notes, description and sample_data say only what the data shows, and the numbers were re-derived from the finished runs (sample_data keys samsung_ffs_a16_set1 to set4).

Test record

Check Result
Lint pylint --disable=C,R on the changed files: 10.00/10; lint_changed.py --base-ref <merge base> (the CI command): 0 new warnings; changed files parse with ast.parse(feature_version=(3, 11)) and hold no 3.12-only f-string form (no Python 3.11 or 3.12 is installed here, so the runtime-contract matrix itself was not run)
Repository checks check_claim_language, check_conversation_column_order, check_html_safety, check_report_local_paths, check_artifact_paths, check_source_path, check_source_file_column, check_artifact_returns, check_implicit_concat, check_artifact_descriptions: all exit 0. validate_sample_data.py (structure): 0 errors, 59 warnings (upstream main has 59)
Host and upstream baseline Windows host, run with TZ=UTC. check_vendored.py exits 1 with output identical to upstream main on this host (the Windows checkout changes the line endings the recorded hashes cover). python -m unittest discover -s admin/test/scripts: 1576 tests on upstream main with 80 failures and 100 errors (Windows paths and permissions); 1576 tests on this branch, the same 167 distinct failing names. check_pr_test_data.py needs a token with push access to the base repository (HTTP 403 with a fork token) and was not run; the bot comment on the PR is its result.
run_test_cases.py PASS=134, no FAIL (upstream main PASS=132, plus the 2 new cases)
run_test_cases.py --storage-views PASS=165, KNOWN_FAIL=5 (the 3 on upstream main and the 2 second-tenant legs of the new cases, reasons in known_failures.json), SKIP=64, no FAIL
Full tool run, validate_sample_data.py --emit on two extractions (all 1,333 modules) completes and reproduces 5,523 and 215 rows. It first refused to emit because the skip message repeated the SQLite text "no such table", which the script treats as an unexplained database error; the message no longer carries it.
CI The five real workflows show action_required (a maintainer has to approve first-time-contributor runs), so none of the CI jobs has run; the table above is the local equivalent of each of them.

Anything reviewers should know

  • For databases that keep the location table nothing changes. Where it is gone the Address column is blank because there is nothing to read it from, which the notes say; it does not show the photos had no address.
  • Android versions before 16 were not re-run; their rows come from the unchanged LEFT JOIN path.

Co-Authored-By: Claude Sonnet 5.5 [email protected]

🤖 Generated with Claude Code

danjethh and others added 5 commits October 25, 2026 06:02
A Samsung Android 16 cmh.db keeps the location_view in its schema but no longer has
the location table the view selects from, so the Address join failed with
"no such table: main.location" and the artifact reported no rows for a database
holding 213 image rows. The artifact now tests the view first and, when it cannot be
queried, reports the files rows with Address blank. Notes say what the blank means
and what was observed on that database.

Two fully synthetic test cases (invented values): the classic schema with a location
table, and the Android 16 shape with the table dropped. The second one returned no
rows before this change.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
cmh.py parses byte-identical cmh.db copies once (one database appears under aliased
paths), and the second-tenant leg restages the same bytes under another user, so the
copy is dropped and the count cannot double. The reason is written in
known_failures.json.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… add sample_data, keep the skip log line free of database error text

check_artifact_output.py reported Date Added, Date Modified, Title and Bucket Name
empty on all 5,523 image rows of a second Android 16 database; they are NULL in
the files table. The notes now say so. The location_view skip message no longer
repeats the SQLite error text, which validate_sample_data.py --emit treats as an
unexplained database error.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ample_data

Counts confirmed with independent queries on each user's cmh.db: 4,561 + 21 and 1,447 + 3 image rows.
Upstream main returns 0 and 3 rows on them; this branch returns 4,582 and 1,450.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The four Android 16 keys name extractions that are not in the corpus
registry, so the counts cannot be reproduced from them. The notes keep
the row counts for those databases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@abrignoni
abrignoni merged commit 1f9c5a3 into abrignoni:main Oct 25, 2026
26 checks 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.

2 participants