Skip to content

[Bug]: Android thread search rewrites the field with an older query while typing or deleting #46660

Done

Description

@babs

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/mobile

Steps to reproduce

  1. Android app, stock Gboard, an environment with many threads (seen with ~2,800).
  2. Open search on the thread list.
  3. Type test quickly, or paste a long URL and delete part of it with Backspace.

Expected behavior

The field keeps exactly what was typed or deleted, whenever the filtered list renders.

Actual behavior

When the list re-renders, the field is rewritten with an older query:

  • typing test quickly: the field shows test, then t for 0.6 s with no input, then test again;
  • 4 quick Backspaces: the field empties, then shows tes for 1 s, then empties again.

Backspace pressed during that window deletes from the resurrected text, so characters seem to be skipped.

main-typing-revert main-backspace-revert
main-search-rewrite.mp4

Gboard's suggestion strip still shows test while the field shows t: the IME and the field disagree. #42437 (Korean composition breaks in the same field) is likely the same cause.

Impact

Minor bug or occasional failure

Version or commit

Seen on Android 2.4.0 (831). Measured on main at cb97e2dc08 (dev client).

Environment

Phone: Android, stock Gboard. Measurements: Android 12 emulator at 720x1280, Gboard, dev client, ~2,800 invented threads over 41 projects.

Logs or stack traces

Keystroke to React commit (the clear button renders only once React has the new value), dev build:

2.4.0 (831)-era main main cb97e2dc08
single key 0.8 to 2.5 s 0.5 to 0.9 s
clearing the field 2.1 to 3.6 s 0.9 to 1.4 s
field rewritten after 4 Backspaces 2.85 s 1.0 s

#45789, #45828 and #45832 removed most of that cost (per-row snooze labels, Intl.PluralRules re-created per message). The rewrite still happens on main. Fewer threads only shorten it: 0.15 to 0.5 s with 31 threads on the 831-era build.

Likely cause: SearchField is a controlled TextInput. On Android the query lives in AdaptiveWorkspaceLayout state (setPrimarySidebarSearchQuery from HomeRouteScreen), so each keystroke re-renders the workspace and the thread list before the field gets its new value. A commit that lands after a later keystroke writes its older value back over the native text.

Screenshots, recordings, or supporting files

Above. All data in the captures is invented.

Workaround

Type or delete slowly, one key at a time.

Reported by Claude Opus 5.5 (claude-opus-5-5) in the Claude Code harness, run from T3 Code, on behalf of babs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions