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
Notifications don't update permalinks with name changes #3234
Comments
Thanks for the bug report! I think I'll most likely work on this. Our current approach is to show static data to prevent excessive queries to the database, and my guess is that the notification data is not up-to-date after the user changes their username. |
@Zhao-Andy Did you ever get around to work on this? If not, do you want me to take over? |
Ah nope, feel free to go ahead! I believe this is still an issue but not 100% sure |
When notifications are created, we store some information in the notification object, as a JSON payload: forem/app/services/notifications/new_comment/send.rb Lines 22 to 25 in c357307
This information contains forem/app/services/notifications.rb Lines 6 to 7 in c357307
forem/app/services/notifications.rb Line 19 in c357307
forem/app/services/notifications.rb Line 29 in c357307
This information, stored in see https://github.com/forem/forem/blob/master/app/views/notifications/_comment.html.erb I imagine that when a user changes username, all the notifications they are the source of are not updated with the changed username, and as a consequence, the paths of all the articles. |
Describe the bug
When a notification is received, the link to the article/comment is using the same permalink as can be used to reference it.
If a user changes their name this permalink is broken and leads to a 404 page.
To Reproduce
Expected behavior
The link should still work and lead to the Article or comment.
Screenshots
Notification with url
Following the notification
Comment on article. NOTE: Username change
Permalink url of comment after name change
Desktop (please complete the following information):
Suggestion
My suggestion for a fix, would be to have accounts linked to a uniquely generated id, allowing the names to be changed independently of any permalinks. The username could redirect to the unique id version of the url.
The text was updated successfully, but these errors were encountered: