Page MenuHomePhabricator

Prevent VisualEditor from setting preferences for temporary accounts
Closed, ResolvedPublic

Description

Following T335971, it appears the extension is saving preferences for temporary users.
Update the code to treat temporary users like anon users.

Wherever these do something different based on whether a user is anonymous or registered, they may need updating (including comments).

Tests and comments should also be updated.

Notes
To help with searching:

In PHP preferences are saved via UserOptionsManager::saveOptions
In JS preferences are saved via methods defined on options.js: https://gerrit.wikimedia.org/g/mediawiki/core/+/809d4c9a9dd2cff6321cdae7a41e75b6c362cbbd/resources/src/mediawiki.api/options.js

Event Timeline

Aklapper removed a subscriber: VisualEditor.

(Please add codebase project tags to tasks when possible, so such tasks can be found when looking for open tasks related to that codebase - thanks!)

matmarex claimed this task.
matmarex subscribed.

I think this has already been done as part of T332435: Update VisualEditor for IP masking, in changes https://gerrit.wikimedia.org/r/913188 and https://gerrit.wikimedia.org/r/917987. (Please reopen if you find otherwise.)

Ryasmeen subscribed.

Checked this in the following ways:

  1. For logged in users, user preferences are getting stored via mw.user.options.set and not for temp users.

Logged in users:

Screenshot 2023-10-18 at 7.51.31 PM.png (1×2 px, 1 MB)

Temp users:

Screenshot 2023-10-19 at 3.04.02 PM.png (1×2 px, 687 KB)

  1. For logged in users, certain actions such as dismissing the education pop-up or the ve welcome dialog are getting stored via user preferences and both mw.user.options.get('visualeditor-hideusered') and mw.user.options.get('visualeditor-hidebetawelcome') returns 1.

Screenshot 2023-10-18 at 8.11.57 PM.png (1×2 px, 383 KB)

For temp users, it's getting stored correctly in Local storage in the ve-hideusered and ve-beta-welcome-dialog entry instead.
User Ed pop-up:

Screenshot 2023-10-19 at 3.22.52 PM.png (1×2 px, 579 KB)
Screenshot 2023-10-19 at 3.22.17 PM.png (1×2 px, 567 KB)

Welcome dialog:
Screenshot 2023-10-18 at 4.25.32 PM.png (1×2 px, 546 KB)
Screenshot 2023-10-18 at 4.25.25 PM.png (1×2 px, 521 KB)