dismissASystemErrorDialog can click any AlertDialog: android:id/button1 hit DocumentsUI's own save dialog #271
Open
opened 2026-09-07 22:08:41 +00:00 by JMR-dev
·
1 comment
No Branch/Tag Specified
main
fix/102-picker-back-press-overshoot
fix/268-saf-picker-determinism
feat/ogg-vorbis-libvorbis
feat/expedited-conversion-work
fix/gate-cache-in-worktrees
chore/gate-runs-shellcheck
test/publish-delete-arm-real-provider
docs/e8-instrumented-coverage
docs/api37-carrier-count-drift
docs/e7-second-constraint
test/publish-to-a-real-saf-destination
fix/api37-report-match-line
fix/api37-task-snapshot-crash
test/join-failure-message-on-device
docs/e2e-read-findings-e7
test/cancelling-a-running-export
test/reattach-to-a-running-job
test/content-uri-reaches-ffmpeg
fix/launcher-wiring-waits-for-the-pick
fix/cancel-tests-need-a-slower-encode
test/cancelling-a-running-join
test/cancelling-a-running-session
test/notification-cancel-action
test/ffmpeg-progress-is-observed
test/fallback-asserts-the-path
test/flac-and-opus-assert-their-format
docs/e2e-read-findings
docs/wave4-coverage-numbers
fix/injectable-startup-sweep-scope
test/session-outcome-seam
test/launcher-callback-identity
test/theme-follows-system-dark
test/audio-drop-arm
fix/rotation-waits-for-recreation
fix/convert-guards-on-ready
test/retry-save-mime
test/hardware-progress-reaches-workmanager
test/ffprobe-mapping-seam
test/device-codec-enumeration-seam
test/unknown-container-row
test/null-message-fallbacks
test/cancel-reaches-workmanager
docs/coverage-wave3-recovery
test/concat-engine-seam
docs/coverage-wave3
test/mediaprobe-merge-seam
test/adaptive-shell-wiring
test/aac-audio-args
test/notification-progress-text
test/media3-muxer-guard
test/hardware-fallback-and-cancellation
test/unprobeable-join-clip
test/one-branch-outcomes
test/foreground-type-regimes
fix/bound-wedge-diagnostics
docs/coverage-wave2
test/screen-wiring
test/viewmodel-setters
test/join-state-mapping
test/conversion-state-mapping
test/dedupe-user-messages
fix/restore-stack-merges
test/refused-jobs
test/concatworker-failure-arms
test/container-capabilities-audio
test/readspec-enum-fallbacks
test/outputpublisher-seams
test/mediaprobe-track-seam
test/outputpublisher-partial-branches
test/fake-provider-scaffolding
docs/coverage-read-findings
chore/gitignore-kotlin
test/bound-the-hangs
docs/coverage-remeasure
ci/baseline-counter-precision
fix/invalid-suggestion-chip
ci/wedged-leg-report
fix/reattachment-overwrites-pick
test/theme-live-branches
fix/failed-save-retry
fix/empty-composition-crash
ci/advisory-failure-report
docs/seven-run-counts
test/release-permission-guard
ci/build-workflow-permissions
docs/api37-point-release
docs/benchmark-populate-path
fix/dead-assertion-probe-test
ci/actionlint
test/device-codecs-encode-consequence
fix/sdkmanager-pipefail
docs/readme-restart-claim
fix/saf-picker-root-discovery
fix/probe-dispatcher-seam
test/media3engine-mime-tables
test/mediaprobe-pure-helpers
fix/codec-vocabulary-drift
docs/robolectric-rationale-correction
docs/api37-advisory-counts
test/r38-8-saf-e2e
test/r38-7-join-states
test/r38-6-conversion-states
test/r38-5-state-seam
fix/jacoco-robolectric-coverage
docs/instrumented-tests-correction
test/r38-2-filecard
test/r38-4-advanced-picker
test/r38-3-pickers
tools/file-issue-script
tools/api-37-emulator
fix/review-app-gaps
docs/review-corrections
No results found.
Labels
Clear labels
above-cut
accessibility
backlog
bug
confirmed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
plausible
question
sev:high
sev:low
sev:medium
wontfix
Worked autonomously overnight: local, JVM-verifiable, no product decision
Barrier affecting people with disabilities
Held for manual review: product/UX call, CI/workflow, hardware, or unverifiable here
Something isn't working
Reviewer demonstrated the defect
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Good for newcomers
Extra attention is needed
This doesn't seem right
Reviewer could not fully demonstrate it; treat as unproven
Further information is requested
High severity
Low severity
Medium severity
This will not be worked on
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: JMR-dev/LibreMediaConverter#271
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Found while tracing #102's
MainActivity-destroyed mode. Recorded rather than acted on there,because it is a separate decision from the one that PR makes.
What it is
SafPickerRoundTripTest.ERROR_DIALOG_BUTTONSis the listdismissASystemErrorDialogwalks:Its KDoc says the ids are used rather than the button text because the text is localised, and by id
rather than "the first button in the system window" "because that would click whatever system
window happened to be there". The first two ids are app-error-dialog specific and hold that line.
android:id/button1does not: it is the framework's genericAlertDialogpositive button, presenton every
AlertDialogin every app on the device. The KDoc's own reason for it —"catches the plainer
BaseErrorDialogshapes that have noaerr_ids" — is true, and so is theother half nobody wrote down.
It has actually clicked something else
Measured on the API 35 gating leg of run
34161043035attempt 1, in the per-test logcat foraFailedSaveDeletesTheDocumentItCouldNotWrite:Both
aerr_ids missed andbutton1hit. Three hundred milliseconds later the save pickerreturned and
MainActivitycame back, so what was clicked was a button in DocumentsUI's owncreate-document flow — not a system error dialog.
dismissASystemErrorDialogcompleted a savedialog it believed it was dismissing an ANR from.
On that run it did no harm and arguably helped: the walk had already timed out. There is no
reason it always would. The same click on a "Discard"/"Cancel"/"Replace?" button is a silent
change to what the test did, and the test would then assert against a document it did not mean to
create — the failure mode this class is least able to notice, because everything downstream still
looks like a save.
Why it is a decision rather than an obvious delete
button1was added for a real reason and deleting it narrows what can be dismissed. The threecandidate answers, in the order I would try them:
dismissASystemErrorDialogexists for dialogs owned bysystem_server, which show as packageandroid.By.res("android:id/button1").pkg("android")keeps the
BaseErrorDialogcase and cannot match DocumentsUI. Cheapest, and it is the KDoc'sstated intent expressed in the selector.
button1on a genuine error dialog. If none was, it is carrying risk for a case that has nothappened.
has to name the hazard rather than claim the opposite.
Done means
Either the selector cannot match a non-system dialog, or the KDoc stops saying it will not click
"whatever system window happened to be there" while the last entry does exactly that. A one-line
@Suppress-style hand-wave is not it: the sentence in the KDoc is currently false, and that is thepart that has to change either way.
Related: #102 (
docs/ci-failure-modes.md, mode 6), #93 which is where the dismissal came from.Two things I can add now, one of which upgrades this from "a button in DocumentsUI" to
"almost certainly its Save button".
The coordinate says which button
The click was at (927, 2274). The emulator is 1080 wide, and the other
UiObject2clicks inthe same test's logcat give the scale — the fixture list item is at
boundsInScreen: Rect(196, 1035 - 497, 1086), and the launcher-ANR dismissal that did findaerr_waitclicked (540, 1359), i.e. horizontally centred. (927, 2274) is bottom-right of thescreen, which is where a Material dialog's positive action sits and is nowhere near a centred
system error dialog's button. Combined with what happened 339 ms later —
MainActivityresumedand
PickActivity's window went away — the reading is that this clicked DocumentsUI's ownsave/confirm button, not merely "something in DocumentsUI".
It is still an inference from geometry plus effect rather than from a node dump, and I would keep
it labelled that way.
It is the same incident as #102's destroyed Activity, not a separate finding
I filed these as two, and on re-reading the trace they are one.
dismissASystemErrorDialogfalling through to
button1is what closed the picker on that run:From
36.033there was nothing left to back out of — anddismissThePickerthen spent two moreback presses, the second of which finished
MainActivity. So this ticket is not only a latenthazard; on the one occurrence anybody has traced it is the first step of the failure #272 fixes.
That does not change what this ticket asks for, and it does not make #272 depend on it: #272 stops
the presses regardless of what closed the picker. It does mean the "it did no harm on that run"
line in the body above is too generous — what it did was make the app focused while the loop still
believed it was not, which is exactly the state #272 now re-reads for.