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

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

Event Timeline

santhosh created this task.Sep 7 2015, 4:15 AM
santhosh updated the task description. (Show Details)
santhosh raised the priority of this task from to Needs Triage.
santhosh added a project: Notifications.
santhosh added a subscriber: santhosh.
Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptSep 7 2015, 4:15 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Legoktm added a subscriber: Legoktm.Sep 7 2015, 4:17 AM

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

Mooeypoo added a subscriber: Mooeypoo.EditedSep 8 2015, 12:02 AM

<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.

Mooeypoo claimed this task.Sep 8 2015, 12:14 AM
Mooeypoo set Security to None.

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

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

santhosh closed this task as Resolved.Sep 8 2015, 3:46 AM

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.