Page MenuHomePhabricator

Everytime I click on Echo toolbar icon, a network request is generated, even while closing
Closed, ResolvedPublic

Description

Updated Echo to master. Clicked on the alert icon in toolbar. Clicked again to close it. Repeated this several times.
The network logs looks like as below

fbstatus1.png (245×1 px, 75 KB)

I believe it is not intentional to fetch messages on every open and close of icon.

Event Timeline

santhosh raised the priority of this task from to Needs Triage.
santhosh updated the task description. (Show Details)
santhosh added a project: Notifications.
santhosh subscribed.
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

It *is* intentional to fetch new messages on the opening of the flyout (Echo has been doing this since ever), but not on closing.

<s>Clicking the badge doesn't close it, it triggers a reopen.</s> (Edit: Sorry, that's not true. I'm investigating now to see if the widget allows for differentiating between toggle "on" and toggle "off".)

That said, this should be fixed now, as I've added a safeguard against pulling multiple times while there's an ongoing request.

Change 236693 had a related patch set uploaded (by Mooeypoo):
Only send api request if the popup is opening

https://gerrit.wikimedia.org/r/236693

My investigation was fruitful, there's a fix now. The popup will now only send an API request when it is being opened, not when it is closed. There is a safeguard against multiple consecutive clicks, so the API request will not be sent if one is already underway.

Change 236693 merged by jenkins-bot:
Only send api request if the popup is opening

https://gerrit.wikimedia.org/r/236693

Thanks, tested and confimed it is fixed

The popup will now only send an API request when it is being opened, not when it is closed.

Checked in betalabs. No additional API requests when Alert/Messages popups are closed.

Double (or multiple subsequent) clicks will send additional requests though.