Page MenuHomePhabricator

SET does not seem to respect user's existing cookie if no preference is set
Closed, ResolvedPublic1 Story Points

Description

I made this test a while ago in an incognito window:
edited a page in WT while logged-out; created an account; was prompted to edit in VE.
The SET system is supposed to remember my last editor.

Details

Related Gerrit Patches:

Event Timeline

Elitre created this task.Apr 21 2016, 4:23 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 21 2016, 4:23 PM
Elitre updated the task description. (Show Details)Apr 21 2016, 4:27 PM

Steps to reproduce:

  1. Log out.
  2. Go to https://en.wikipedia.org/wiki/Special:Random
  3. Click the Edit button, and get the wikitext editor.
  4. Click "Create account" at the top of that page (wikitext editor is still open)
  5. Create an account.
  6. See the same article open automatically in the visual editor.

Jdforrester-WMF renamed this task from Please verify that cookies are working correctly for logged-out editors at en.wiki to SET does not seem to respect user's existing cookie if no preference is set.Apr 25 2016, 6:38 PM
Jdforrester-WMF triaged this task as Medium priority.
Jdforrester-WMF set the point value for this task to 1.Apr 28 2016, 5:36 PM

We don't give you a choice to use VE while you're logged out, so we shouldn't save it as a cookie/preference.

AlexMonk-WMF added a comment.EditedApr 30 2016, 2:25 PM

Also, in MediaWiki, if a user hasn't got a preference set then the value is the default one, not just null/undefined.

It's possible for IPs to use the visual editor, e.g., if they manually change the URL. Whether we're "giving them a choice" or not, some of them are actually using it at the English Wikipedia, so it would be nice to have their preferences respected – in both directions, i.e., not dumping an IP editor with lots of wikitext experience into the visual editor after account creation.

Jdforrester-WMF raised the priority of this task from Medium to Unbreak Now!.May 12 2016, 3:44 PM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

Argh, I assumed this was fixed. :-(

We don't give you a choice to use VE while you're logged out, so we shouldn't save it as a cookie/preference.

Not true.

Also, switching is still possible via the toolbar.

Restricted Application added subscribers: Luke081515, TerraCodes, Urbanecm. · View Herald TranscriptMay 12 2016, 3:44 PM

The preference is either set to a non-default value, or not set and just falling back to default.

The preference is either set to a non-default value, or not set and just falling back to default.

I suggested to Alex that we could do this via reading the 've-beta-welcome-dialog' value.

I thought about that, but while you're logged out, that can't be saved as a preference to be read back when you're logged in, what we actually do is save it in local storage (unless that fails, in which case we use a cookie) - which we can't read on the server side.

@Jdforrester-WMF: This task was set to "Unbreak now" priority a month ago and has not seen updates for a month.
Who is supposed to work on this task as an assignee?

Alex, does your last comment mean "VisualEditor can see the existing cookie while you're logged out, but it can't see the existing cookie after you login"?

I think what I meant was that the data needed is not necessarily provided to the server.

Okay, how about this: When you log in with the cookie having been set, we look at your cookie and set your user's preference to it?

Okay, how about this: When you log in with the cookie having been set, we look at your cookie and set your user's preference to it?

That sounds like it could work well enough, I think.

I'm not 100% confident in this but am going to give it a go.

Change 295312 had a related patch set uploaded (by Alex Monk):
When logging in, if VEE cookie is set, change the user's preference to match it

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

Change 295312 merged by jenkins-bot:
When logging in, if VEE cookie is set, change the user's preference to match it

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

Jdforrester-WMF closed this task as Resolved.Jun 29 2016, 12:34 PM
Jdforrester-WMF removed a project: Patch-For-Review.