Project

General

Profile

Actions

Bug #10358

closed

User name bug adding #2 to username

Added by Sonja Leix over 5 years ago. Updated over 5 years ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
cuny.is
Target version:
Start date:
2018-09-20
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

Hi Boone,
I just registered for a CUNY AC account and thought no other account with the username "sonjaleix" exists, it created a account url of /sonjaleix2
Matt asked me to report this bug to you to look into.

Actions #1

Updated by Boone Gorges over 5 years ago

  • Status changed from New to Reporter Feedback

Hi Sonja, and welcome! I don't see an account with username 'sonjaleix2'. See https://commons.gc.cuny.edu/members/sonjaleix/. Can you give more details about where you see 'sonjaleix2'?

Actions #2

Updated by Sonja Leix over 5 years ago

You're correct, that link doesn't have it, but the quick link does, which seems to be a shortened link that redirects to the potentially wrong profile URL:
Quick link: http://cuny.is/sonjaleix2 => redirects to https://commons.gc.cuny.edu/members/sonjaleix2/

See profile screenshot: https://www.dropbox.com/s/ybq22il8cvp76dh/Screenshot%202018-09-20%2012.06.13.png?dl=0

Actions #3

Updated by Boone Gorges over 5 years ago

  • Category name changed from Commons Profile to cuny.is
  • Status changed from Reporter Feedback to Assigned
  • Target version set to 1.13.10

Ah, I see now. Thanks for the clarification.

The "shortlink" system is a separate piece of software called YOURLS, and the Commons communicates with it via API. When your user profile is first loaded, the Commons sees that you don't yet have a shortlink, so it goes to YOURLS to fetch one. It'll only try -2 etc suffixes if it thinks that the unsuffixed version is already taken. In this case it is not, so clearly there's something amiss. I'll do some digging to figure out how it might have happened.

In the meantime, I'm manually changing your shorturl.

Actions #4

Updated by Boone Gorges over 5 years ago

  • Status changed from Assigned to Resolved

Looking through the YOURLS bridge code, there are a few issues:

1. The bridge was mistakenly using the suffixed username to generate a URL. This is why the shorturl was set to the (non-existent) commons.gc.cuny.edu/members/sonjaleix2. This logic is fixed in https://github.com/cuny-academic-commons/cac/commit/e24ae877d375b3929afa35920c35c5600683763f
2. This one is an educated guess, but the bridge code was failing in a not-very-graceful way when YOURLS could not be reached for some reason. These failures were interpreted as the API thinking that the keyword (eg 'sonjaleix') was available for use. But then this fell through to another failsafe that checks to be sure that the available keyword doesn't match the username of an existing user. In this case, it did, so the 'sonjaleix' keyword was rejected. This is why it moved on to fetch a suffixed version. I've put some more graceful failures in place so that the process bails early when YOURLS cannot be reached. https://github.com/cuny-academic-commons/cac/commit/baed00cc8a08e1366f08324867740ecae957368b https://github.com/cuny-academic-commons/cac/commit/57bac5fc5334617d351a53c5e7e1434f53bc5c1d

We don't have reliable ways to reproduce the problem - it was due to network latency or something - so there's not much to test here. Marking resolved.

Actions

Also available in: Atom PDF