Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursively identify renamed username of submitter #291

Merged
merged 3 commits into from
Apr 15, 2024

Conversation

sohomdatta1
Copy link
Contributor

Fixes #90

@sohomdatta1
Copy link
Contributor Author

cc @NovemLinguae

@sohomdatta1
Copy link
Contributor Author

I wish we had reviewerbot here :)

@sohomdatta1 sohomdatta1 marked this pull request as draft August 30, 2023 03:59
@sohomdatta1 sohomdatta1 marked this pull request as ready for review August 30, 2023 06:29
src/modules/submissions.js Outdated Show resolved Hide resolved
src/modules/submissions.js Outdated Show resolved Hide resolved
src/modules/submissions.js Outdated Show resolved Hide resolved
src/modules/submissions.js Outdated Show resolved Hide resolved
src/modules/submissions.js Show resolved Hide resolved
src/modules/submissions.js Outdated Show resolved Hide resolved
this.params.u = newName;
this.getSubmitter().done( function ( user ) {
deferred.resolve( user );
} );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if it fails? The deferred is not being rejected in that case which leaves it hanging in a never-resolved/never-rejected state.
It would be good to convert the method to return the deferreds/promises rather than manually resolve/reject in a then block. Fine to leave for later as it's problem common to the entire codebase.

@NovemLinguae
Copy link
Member

This bug was reported again today. Looks like this patch needs a round of code review feedback to be implemented in order to move forward.

@siddharthvp
Copy link
Member

The inline comments can be easily resolved, but I'm not sure of the approach. Instead of tracking down renames from log events, I think it would be faster and easier to just follow the redirect (redirect=1 API flag) while editing the talk page, as the user talk page at the old name redirects to the right talk page. Even if the user is renamed multiple times, someone would have fixed the double redirect. This is also the original ask at #90.

@sohomdatta1
Copy link
Contributor Author

Sorry this dropped off my radar

The inline comments can be easily resolved, but I'm not sure of the approach. Instead of tracking down renames from log events, I think it would be faster and easier to just follow the redirect (redirect=1 API flag) while editing the talk page, as the user talk page at the old name redirects to the right talk page. Even if the user is renamed multiple times, someone would have fixed the double redirect. This is also the original ask at #90.

That would work for most renames yes, but we also end up with cases where a user might request deletion of their previous usernames due to personal information concerns (which I assume is more amongst new users due to banner blindness on registrations).

This would also handle those cases as well.

@NovemLinguae
Copy link
Member

In the case of a non-renamed user having a user talk that redirects somewhere else, would this patch follow the redirect? (I think it should. Appending AFC messages to a redirect page is bad.)

I agree with siddharthvp's concerns. If we can solve the problem by adding a parameter to an existing API query, I think that's preferable to using complicated recursion. Could still be convinced otherwise though, but that's my initial thought.

@sohomdatta1
Copy link
Contributor Author

sohomdatta1 commented Jan 27, 2024

It probably wouldn't but then again, that could be solved by including redirect:true in addition to this change.

However, I'm somewhat unconvinced that the case (redirecting user talk pages without renames) is going to be prevalent amongst new users, compared to the case of creating a user account with the same name as a company and then requesting a rename and a deletion of the previous username's redirects to prevent association.

If we do go with only checkinh redirects, that would not address the deleted redirect scenario and instead create user talk pages for users that don't exist.

@NovemLinguae
Copy link
Member

I suspect the usual workflow would be softblock because of organizational or role name -> user follows directions and requests name change -> name is changed, with the name changing process creating redirects. I doubt they would know how to request deletion of the redirects nor would they be motivated to.

Want to go ahead and make the little changes suggested above so this is easy to merge if we decide to keep the current approach?

NovemLinguae added a commit to NovemLinguae/afc-helper that referenced this pull request Apr 10, 2024
Fixes wikimedia-gadgets#90

Advantages
- Simpler than patch wikimedia-gadgets#291
- The original intent of the function notifyUser was to follow redirects, indicated by the comment "Follows redirects and appends a message to the bottom of the user's talk page." from 2014. So this fixes that bug.

Disadvantages
- Will only follow 1 redirect, not 2+ redirects.
- The "Saved [[User talk:OldUsername]] (diff)" message shown to the AFC reviewer will be slightly incorrect. The diff will be correct, but OldUsername should ideally be NewUsername.
@NovemLinguae
Copy link
Member

Tested, works. Primefac supports merging this version. Will merge this on Monday unless there are comments over the weekend.

NovemLinguae added a commit to NovemLinguae/afc-helper that referenced this pull request Apr 12, 2024
This code does NOT follow redirects as currently written. Patch wikimedia-gadgets#291 will handle this a different way.
siddharthvp pushed a commit that referenced this pull request Apr 13, 2024
Fixes #90

Advantages
- Simpler than patch #291
- The original intent of the function notifyUser was to follow redirects, indicated by the comment "Follows redirects and appends a message to the bottom of the user's talk page." from 2014. So this fixes that bug.

Disadvantages
- Will only follow 1 redirect, not 2+ redirects.
- The "Saved [[User talk:OldUsername]] (diff)" message shown to the AFC reviewer will be slightly incorrect. The diff will be correct, but OldUsername should ideally be NewUsername.
@NovemLinguae NovemLinguae merged commit 29dd700 into wikimedia-gadgets:master Apr 15, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Script should follow user talk page redirects
3 participants