Page MenuHomePhabricator

SET does not seem to respect user's existing cookie if no preference is set
Closed, ResolvedPublic1 Estimated 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.

Event Timeline

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.

Screen Shot 2016-04-21 at 9.28.48 AM.png (732×1 px, 216 KB)

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.

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.

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

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.

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