Skip to content

feat(thumbjar): exit thumbjar prepare with its own status when Gboard's Japanese dictionary never loads - #3590

Merged
christianhg merged 2 commits into
mainfrom
ci/ja-dictionary-retry
Nov 5, 2026
Merged

christianhg merged 2 commits into
mainfrom
ci/ja-dictionary-retry

Conversation

@christianhg

@christianhg christianhg commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Some Japanese Android IME jobs go red before any typing: on that emulator boot Gboard never loads its Japanese dictionary, falls back to its minimal engine and cancels its dictionary pack downloads, so the prep fails after its 360-second wait. Two of the last 40 Japanese jobs failed this way. The device is reachable, so the job never retried, and its result says nothing about the editor.

thumbjar prepare now exits 3 when the dictionary never loaded and 1 for every other prep failure, so its caller can tell the two apart without reading the reason. run-on-device.sh writes a PREP DICTIONARY_NOT_LOADED line for status 3, and the job retries once on a fresh emulator when that line comes with a reachable device, with a DICTIONARY_RETRY line in the summary. A second dictionary failure fails as infrastructure, not as a test result. Every other prep failure on a reachable device still stays red, and so does a test failure on a reachable device. The job caps already budget a full retry, so they don't change.

Two things the status exposed in prepare.sh are fixed in the same commit. The prep used to end with the status of its last command, adb reverse --list, which could fail the prep with no reason. The listing is diagnostic, so its status is now logged and the prep goes on. The adb reverse that sets up the port still fails the prep. The reason the prep quotes also comes only from the bytes this wait added to ja-dictionary.log, since a retry appends to the same log.

Not verified on a real failing boot, since the dictionary failure can't be forced on an emulator. The unit tests use the reason a real CI boot logged.


Note

Low Risk
Changes are limited to Android CI prep, retry heuristics, and thumbjar dictionary wait exit codes—not editor runtime or production paths.

Overview
Japanese Android IME jobs could fail during device prep when Gboard never loads its Mozc dictionary on that boot, even though the emulator was fine—so CI never retried and the failure looked like a generic prep error.

thumbjar prepare now exits 3 when the dictionary wait times out (still 1 for capture faults, post-load conversion checks, and other prep failures). run-on-device.sh records PREP DICTIONARY_NOT_LOADED in timing.txt for that status, and emulator-runs.mjs treats a reachable device plus that marker like boot/adb flakes: one fresh emulator with a DICTIONARY_RETRY summary line. A second dictionary miss on the retry is reported as infrastructure, not an editor test failure; other reachable-device prep/test failures still do not retry.

The same prep work also stops adb reverse --list from deciding exit status (logged only) and reads dictionary failure text only from this run’s bytes appended to ja-dictionary.log, so retries do not mis-parse an earlier boot’s log.

Reviewed by Cursor Bugbot for commit 8549c7d. Bugbot is set up for automated code reviews on this repo. Configure here.

…rd's Japanese dictionary never loads

`thumbjar prepare` exited 1 for every failed step, so a caller could
only tell a dictionary that never loaded on that boot from any other
failure by reading the prose of its reason. That outcome comes from the
boot, not the page, and a fresh emulator usually loads it.

`waitForDictionary` now returns a `not-loaded` outcome of its own when
no load line came by the deadline, and `dictionary.js wait` exits 3 for
it. `prepare.sh` carries that status through the `prep` subshell, its
deadline and its last `exit`. A capture that cannot show the load, a
failed check after the load, the Japanese setup, the deadline and every
other step still exit 1. The README documents both statuses.

So only that wait can exit 3, `prep` now ends with an explicit success
and logs the status of its last command, `adb reverse --list`, which
had decided the prep's status and failed it silently. The reason the
prep quotes comes only from the bytes this wait added to
`ja-dictionary.log`, since a retry in the same out dir appends to it
and an earlier prep may have left its last line unterminated.
…y never loads

A Japanese job whose dictionary never loaded failed in prep on a
reachable device, so it was red without a test result and never
retried, though a fresh emulator usually loads it.

`run-on-device.sh` reads `thumbjar prepare`'s exit status and, for 3
only, writes a `PREP DICTIONARY_NOT_LOADED` line to `timing.txt` beside
the quoted reason. `emulator-runs.mjs retry` retries a first run with
that line and a `CHECKED device` verdict once, with a `DICTIONARY_RETRY`
line in the log and the job summary. A lost device stays a
`DEVICE_LOST_RETRY` and an unchecked run is still not retried. The
result names the dictionary as the retry's reason, and a retry whose
dictionary never loaded again fails as an infrastructure failure. The
job caps already cover a retry in full, so they are unchanged.
@changeset-bot

changeset-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8549c7d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
portable-text-editor-documentation Ready Ready Preview Nov 5, 2026 2:43pm UTC
portable-text-example-basic Ready Ready Preview Nov 5, 2026 2:43pm UTC
portable-text-playground Ready Ready Preview Nov 5, 2026 2:43pm UTC

Request Review

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Bundle Stats

✅ No significant changes.

All scenario measurements (37)

🗺️ @portabletext/block-tools / @portabletext/block-tools · @portabletext/block-tools / @portabletext/block-tools/rules · @portabletext/editor / @portabletext/editor · @portabletext/editor / @portabletext/editor/behaviors · @portabletext/editor / @portabletext/editor/plugins · @portabletext/editor / @portabletext/editor/selectors · @portabletext/editor / @portabletext/editor/traversal · @portabletext/editor / @portabletext/editor/utils · @portabletext/editor / defineSchema · @portabletext/editor / useEditor · @portabletext/editor / typical · @portabletext/html / @portabletext/html · @portabletext/html / @portabletext/html/rules · @portabletext/html / htmlToPortableText · @portabletext/keyboard-shortcuts / @portabletext/keyboard-shortcuts · @portabletext/markdown / @portabletext/markdown · @portabletext/markdown / portableTextToMarkdown · @portabletext/patches / @portabletext/patches · @portabletext/repair / @portabletext/repair · @portabletext/sanity-bridge / @portabletext/sanity-bridge · @portabletext/schema / @portabletext/schema · @portabletext/plugin-character-pair-decorator / @portabletext/plugin-character-pair-decorator · @portabletext/plugin-decorations / @portabletext/plugin-decorations · @portabletext/plugin-dnd / @portabletext/plugin-dnd · @portabletext/plugin-emoji-picker / @portabletext/plugin-emoji-picker · @portabletext/plugin-input-rule / @portabletext/plugin-input-rule · @portabletext/plugin-list-index / @portabletext/plugin-list-index · @portabletext/plugin-markdown-shortcuts / @portabletext/plugin-markdown-shortcuts · @portabletext/plugin-one-line / @portabletext/plugin-one-line · @portabletext/plugin-paste-link / @portabletext/plugin-paste-link · @portabletext/plugin-sdk-value / @portabletext/plugin-sdk-value · @portabletext/plugin-typeahead-picker / @portabletext/plugin-typeahead-picker · @portabletext/plugin-typography / @portabletext/plugin-typography · @portabletext/toolbar / @portabletext/toolbar · @portabletext/toolbar / typical · @portabletext/plugin-table / @portabletext/plugin-table · @portabletext/plugin-table / @portabletext/plugin-table/ui · Artifacts

Scenario Kind Bundle (raw / gzip) Gzip change Import time Import change
⚪ @portabletext/block-tools / @portabletext/block-tools export 338.3 KB / 40.0 KB None 188 ms +1 ms, +0.5%
⚪ @portabletext/block-tools / @portabletext/block-tools/rules export 15.2 KB / 2.1 KB None 5 ms +0 ms, +2.2%
⚪ @portabletext/editor / @portabletext/editor export 1.02 MB / 130.3 KB None 76 ms +4 ms, +5.2%
⚪ @portabletext/editor / @portabletext/editor/behaviors export 4.3 KB / 147 B None 2 ms +0 ms, +3.9%
⚪ @portabletext/editor / @portabletext/editor/plugins export 5.1 KB / 645 B None 7 ms +0 ms, +2.0%
⚪ @portabletext/editor / @portabletext/editor/selectors export 96.3 KB / 9.4 KB None 8 ms +0 ms, +3.2%
⚪ @portabletext/editor / @portabletext/editor/traversal export 46.6 KB / 4.2 KB None 6 ms +0 ms, +2.6%
⚪ @portabletext/editor / @portabletext/editor/utils export 32.8 KB / 4.1 KB None 6 ms +0 ms, +0.7%
⚪ @portabletext/editor / defineSchema consumer 658 B / 69 B None None None
⚪ @portabletext/editor / typical consumer 1.02 MB / 130.0 KB None None None
⚪ @portabletext/editor / useEditor consumer 1.6 KB / 248 B None None None
⚪ @portabletext/html / @portabletext/html export 69.3 KB / 10.1 KB None 7 ms +0 ms, +7.1%
⚪ @portabletext/html / @portabletext/html/rules export 15.2 KB / 2.1 KB None 4 ms +0 ms, +3.0%
⚪ @portabletext/html / htmlToPortableText consumer 69.3 KB / 10.1 KB None None None
⚪ @portabletext/keyboard-shortcuts / @portabletext/keyboard-shortcuts export 7.0 KB / 858 B None 2 ms +0 ms, +4.9%
⚪ @portabletext/markdown / @portabletext/markdown export 425.4 KB / 66.2 KB None 41 ms +1 ms, +3.3%
⚪ @portabletext/markdown / portableTextToMarkdown consumer 338.9 KB / 56.4 KB None None None
⚪ @portabletext/patches / @portabletext/patches export 50.0 KB / 7.7 KB None 4 ms +0 ms, +5.0%
⚪ @portabletext/plugin-character-pair-decorator / @portabletext/plugin-character-pair-decorator export 124.1 KB / 15.8 KB None None None
⚪ @portabletext/plugin-decorations / @portabletext/plugin-decorations export 16.4 KB / 2.3 KB None None None
⚪ @portabletext/plugin-dnd / @portabletext/plugin-dnd export 10.4 KB / 1.8 KB None None None
⚪ @portabletext/plugin-emoji-picker / @portabletext/plugin-emoji-picker export 150.1 KB / 18.6 KB None None None
⚪ @portabletext/plugin-input-rule / @portabletext/plugin-input-rule export 124.2 KB / 15.8 KB None None None
⚪ @portabletext/plugin-list-index / @portabletext/plugin-list-index export 7.4 KB / 1.1 KB None None None
⚪ @portabletext/plugin-markdown-shortcuts / @portabletext/plugin-markdown-shortcuts export 136.4 KB / 17.6 KB None None None
⚪ @portabletext/plugin-one-line / @portabletext/plugin-one-line export 2.6 KB / 608 B None None None
⚪ @portabletext/plugin-paste-link / @portabletext/plugin-paste-link export 4.3 KB / 1.0 KB None None None
⚪ @portabletext/plugin-sdk-value / @portabletext/plugin-sdk-value export 242.1 KB / 32.8 KB None None None
⚪ @portabletext/plugin-table / @portabletext/plugin-table export 61.1 KB / 7.1 KB None None None
⚪ @portabletext/plugin-table / @portabletext/plugin-table/ui export 114.6 KB / 19.5 KB None None None
⚪ @portabletext/plugin-typeahead-picker / @portabletext/plugin-typeahead-picker export 166.1 KB / 19.9 KB None None None
⚪ @portabletext/plugin-typography / @portabletext/plugin-typography export 131.1 KB / 17.0 KB None None None
⚪ @portabletext/repair / @portabletext/repair export 4.5 KB / 636 B None 3 ms +0 ms, +2.7%
⚪ @portabletext/sanity-bridge / @portabletext/sanity-bridge export 275.1 KB / 30.2 KB None 189 ms +5 ms, +2.9%
⚪ @portabletext/schema / @portabletext/schema export 9.9 KB / 1.2 KB None 2 ms +0 ms, +6.1%
⚪ @portabletext/toolbar / @portabletext/toolbar export 153.3 KB / 17.3 KB None None None
⚪ @portabletext/toolbar / typical consumer 145.6 KB / 16.9 KB None None None

Significant means at least 1.0 KB and 1% gzip, or at least 5 ms and 10% import time.

@christianhg
christianhg marked this pull request as ready for review November 5, 2026 14:44
@christianhg
christianhg enabled auto-merge (rebase) November 5, 2026 14:46
@christianhg
christianhg merged commit 16ff12f into main Nov 5, 2026
26 checks passed
@christianhg
christianhg deleted the ci/ja-dictionary-retry branch November 5, 2026 14:57

This branch was successfully deployed

3 active deployments
Preview – portable-text-editor-documentation — 8549c7d8 Deployed Nov 5, 2026 by vercel[bot]
Preview – portable-text-playground — 8549c7d8 Deployed Nov 5, 2026 by vercel[bot]
Preview – portable-text-example-basic — 8549c7d8 Deployed Nov 5, 2026 by vercel[bot]
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