fix(drawer): external site links no longer stop working over time - #17445
Open
about2crash wants to merge 1 commit into
Open
fix(drawer): external site links no longer stop working over time#17445about2crash wants to merge 1 commit into
about2crash wants to merge 1 commit into
Conversation
External link menu items are registered with MENU_ITEM_EXTERNAL_LINK + the link's local database _id. That column is AUTOINCREMENT and the link table is cleared and refilled on every refresh, so the IDs grow without bound. The click handler only accepted an offset of 0-100, so once the IDs passed that window every external link silently stopped responding. Dispatch on the menu group the items were registered under, and resolve the link by ID instead of by display name. Signed-off-by: about2crash <146389368+about2crash@users.noreply.github.com> Assisted-by: ClaudeCode:claude-opus-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
External link menu items are registered with
MENU_ITEM_EXTERNAL_LINK+ the link's local database_id. That column isAUTOINCREMENTand the link table is cleared and refilled on every refresh, so the IDs grow without bound. The click handler only accepted an offset of 0–100, so once the IDs passed that window every external link silently stopped responding, no error, and it never recovers.Dispatch on the menu group the items were registered under, and resolve the link by ID instead of by display name. The latter also fixes two links sharing a display name opening the same URL.
Reproduced with a link at local ID 501 (menu item 612): on master the tap logs
Unknown drawer menu item clickedand nothing happens.🧪 Testing
Verified manually on a device: with a link at local ID 501 in
external_links, the drawer entry does nothing on master and opens correctly with this change.Added
DrawerActivityIT#externalLinkWithIdBeyondLegacyRangeIsOpened, which inserts a link at ID 501 and asserts the drawer entry opensExternalSiteWebViewwith the link URL.🖼️ Screenshots
🏚️ Before (master)
record_before.mp4
🏡 After (this PR)
record_after.mp4
🏁 Checklist
🤖 AI (if applicable)