Fix: notification links with ampersands in page titles work correctly#6348
Fix: notification links with ampersands in page titles work correctly#6348hpr wants to merge 3 commits intowikimedia:mainfrom
Conversation
cooltey
left a comment
There was a problem hiding this comment.
Thank you for submitting the PR to fix it! Removing the decodeURL() here may solve the issue in English articles that contain & in the title, but for the article in other wikis, the URL will be encoded, and if we remove this here, the links will become unavailable and cause more issues.
|
@cooltey, thanks, I tried another approach by storing the encoded URL separately. Compiled this and observed that the fix still works with the above article, if there's another test case I should try let me know. |
|
Thanks! Let's standby on this -- I actually think your original fix is the right idea; we should remove instances of decoding/encoding URLs in places where it's not clear why it's done. And we should definitely not keep both encoded and decoded url fields in a model class like I have a feeling that the proper fix involves just a little more digging into where all these URLs eventually end up, and performing the URL decoding in that single place, instead of multiple places that shouldn't need to be "aware" of url encoding. |
f801603 to
7cc6cc7
Compare
What does this do?
Fixes notification links where page titles have ampersands. These shouldn't be decoded because it breaks parsing by the notification link handler.
Example of bug in Wikipedia Beta:

Example of fixed behavior:

Why is this needed?
To prevent "Empty list doesn't contain element at index 0." bugs on notifications
Phabricator:
https://phabricator.wikimedia.org/T418432