Skip to content

Service extension buttons do not always respond to first click #8497

Description

@kenzieschmoll

service-extension-button-clicks

Activity

  1. self-assigned this
    on Feb 5, 2025
  2. jakemac53 commented on Feb 5, 2025

    @jakemac53
    Contributor

    I looked into this today but wasn't able to get a fix, below are my learnings though:

    • You can reproduce this consistently by minimizing the app you are debugging, all actions will take two clicks
    • The issue is related to us not getting back messages from the vm service web socket until we send the second vm service request (on the second click), or the app is brought into the foreground.
    • I was able to track this all the way back to the raw web socket, we do not get the event for the response at all, so we don't update the internal state, and the button does not toggle its state.
  3. jakemac53 commented on Feb 5, 2025

    @jakemac53
    Contributor

    Ok, I did some more digging and tracked this down to the service extension implementation itself here.

    That call to _forceRepaint() waits for endOfFrame before completing, and endOfFrame explicitly documents that it can take a long time if the screen is off. I indeed confirmed endOfFrame doesn't complete until either something else calls _forceRepaint (which is why the 2nd click works), or the app is brought into the foreground.

    That does make the fix somewhat unclear - we could just not await this future inside the service extension as one option.

    Or, we could show a spinner or something when you click the button, to indicate we are waiting for the response.

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

Metadata

Metadata

Assignees

Labels

P2important to work on, but not at the top of the work list.devtools-cross-screenIssues that affect multiple DevTools screens, i.e. shared functionality and widgetsdevtools-inspector-screenfix it friday

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions