Skip to content

Reader: debug 5-tap gesture to reset the Reader database#22807

Merged
nbradbury merged 5 commits intotrunkfrom
feature/reset-reader-db
Apr 22, 2026
Merged

Reader: debug 5-tap gesture to reset the Reader database#22807
nbradbury merged 5 commits intotrunkfrom
feature/reset-reader-db

Conversation

@nbradbury
Copy link
Copy Markdown
Contributor

@nbradbury nbradbury commented Apr 21, 2026

Description

While working on various reader PRs (such as #22808) I've often had to clear storage to reset the reader database, which means logging in again each time. So in this PR tapping the Reader tab 5 times within 2 seconds now shows a confirmation dialog to reset the Reader database.

This is a developer convenience to make it easy to exercise cold-start / fresh-DB paths without having to clear app data. Note that this is only enabled in debug builds.

Also includes a small crash fix in ReaderTagsFeedFragment.removeCurrentPostListFragment() — guarding with isAdded so the method is safe when the fragment is no longer attached.

Testing instructions

  1. Navigate to the Reader tab.
  2. Tap the Reader tab rapidly 5 times within 2 seconds.
  • Verify the "Reset Reader database" confirmation dialog appears.
  1. Tap Cancel.
  • Verify the dialog dismisses and no reset happens.
  1. Trigger the gesture again and tap OK.
  • Verify the Reader screen reloads — tags and posts should re-fetch from the server.
  1. From another tab (e.g., My Site), tap Reader once, wait > 2 seconds, then tap 4 more times.
  • Verify the dialog does NOT appear (window expired).
reset.mp4

nbradbury and others added 2 commits April 21, 2026 10:07
In debug builds, tapping the Reader tab 5 times within 2 seconds now
shows a confirmation dialog. On confirm, the Reader database is reset
and the Reader fragment is recreated so the current screen reloads
with fresh data.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dangermattic
Copy link
Copy Markdown
Collaborator

dangermattic commented Apr 21, 2026

1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Apr 21, 2026

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr22807-ba60584
Build Number1488
Application IDcom.jetpack.android.prealpha
Commitba60584
Installation URL5rsp3e0sbf8co
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Apr 21, 2026

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr22807-ba60584
Build Number1488
Application IDorg.wordpress.android.prealpha
Commitba60584
Installation URL7i6fp44jpulng
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

nbradbury and others added 2 commits April 21, 2026 10:43
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@nbradbury nbradbury marked this pull request as ready for review April 21, 2026 16:02
@nbradbury nbradbury requested a review from adalpari April 21, 2026 16:02
Comment on lines +266 to +267
readerDebugTapCount = if (now - readerDebugLastTapMs > READER_DEBUG_TAP_WINDOW_MS) 1
else readerDebugTapCount + 1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if-else indentation looks pretty weird 😅

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof, that is weird. Fixed in ba60584.

Copy link
Copy Markdown
Contributor

@adalpari adalpari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smart!

@nbradbury nbradbury enabled auto-merge (squash) April 22, 2026 17:36
@nbradbury nbradbury merged commit b8792b3 into trunk Apr 22, 2026
19 of 20 checks passed
@nbradbury nbradbury deleted the feature/reset-reader-db branch April 22, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants