Page MenuHomePhabricator

Explicitly clear AWB "new messages" flag for alternative account users
Closed, ResolvedPublicFeature

Description

Starting AWB logged in under an alternative account, when the browser is logged in under a main account and message is posted to the alternative's talk page, the "You have new messages" prompt is not cleared when the alternative's talk page pops up, and no further editing is allowed. Workaround is to log in using the alternative account in an incognito tab (or another browser) and read the talk page, which of course is not hard.

A proposed fix: add a public method, say "ClearHasMsg" to WikiFunctions\API\ApiEdit.cs containing the call:

HttpPost(new Dictionary<string, string> { { "action", "clearhasmsg" } },  new Dictionary<string, string>());

and call TheSession.Editor.SynchronousEditor.ClearHasMsg() in WeHaveNewMessages(), immediately after displaying the talk page.
I don't believe this will introduce any regressions, because by virtue of displaying the talk page the flag will be cleared anyway for non-alternative users.

I acknowledge this is the lowest of priorities, as I may be one of very few (or no other) editors using an alternative account, and it rarely gets messages. But it seems to also affect bots, and would be an easy solution to T347252.

Event Timeline

Pppery subscribed.

I've ran into the same issue a few times myself.

Adding a message to the "View Message" pop-up, explicitly asking the user to "visit the [alternative (bot in my case) acct] talk page while logged in as [the alt account]" will obviate the need for any fixes.

A string change there should be very easy and the ROI will be positive, IMO.

In any case, thanks for taking care of this great tool.

In my private build I actually named the method ClearNewMessages(), which I think is more correct. I really don't see a compatibility problem with adding this. If the HttpPost() fails, as far as I can see any exception is swallowed, but that probably means nothing will work anyway.

@DavidBrooks Approach seems fine to me - we've showed the user the talk page, we can't force them to read it and don't know if the message is relevant to their AWB use anyway, so clearing messages flag thereafter seems reasonable to me.

Have you tested the changes you describe? If yes, please provide a diff/patch file (if using local SVN), or a link to equivalent diff/branch if you are using github etc. then I'll apply it.

Yes, I've tested, in both the other-account and same-account scenarios. I keep my sources on Azure Devops because reasons, but I've attached the text output of a git diff on a base of rev 12695:

and although I'm not very familiar with svn, I've attached what I hope is the right patch file:

Rjwilmsi claimed this task.

rev 12697 Explicitly clear AWB "new messages" flag for alternative account users. Patch from DavidBrooks.

Will be in next release of AWB.