This is branched off from https://phabricator.wikimedia.org/T307529.
=== How many times were you able to reproduce it?
Every time
=== Steps to reproduce
# Trigger a user talk page message by writing to your talk page under a topic title that contains special or non-latin characters.
# Fetch user talk page message notification from Notifications API, e.g.
https://en.wikipedia.org/w/api.php?action=query&format=json&formatversion=2&meta=notifications¬filter=!read¬format=model¬limit=max¬wikis=enwiki
=== Expected results
Urls within the `links` object have fragments encoded
=== Actual results
Urls within the `links` object contains special characters within fragments that are not encoded
This causes our URLs to fail to decode on the iOS side. We have loosened our decoding a bit to fix the worst bugs, but we are still unable to link directly to a talk page topic without an encoded fragment.
Example response from GU Wikipedia:
#c-Aniket-2022-05-03T16:16:00.000Z-**સ્વાગત!**"
```
...
"header": "New user message left a message on <strong>your talk page</strong>.",
"compactHeader": "New user message left you a message.",
"body": "પ્રિય Tsevener, શુભ સંધ્યા, ગુજરાતી વિકિપીડિયામુક્ત વિશ્વજ્ઞાનકોશમાં જોડાવા બદલ આપનો આભાર અને અહીં આપનું હાર્દિક સ્વાગત છે! જગતભરના જ્ઞાની લોકોથી લ...",
"icon": "edit-user-talk",
"links": {
"primary": {
"url": "https://gu.wikipedia.org/wiki/%E0%AA%B8%E0%AA%AD%E0%AB%8D%E0%AA%AF%E0%AA%A8%E0%AB%80_%E0%AA%9A%E0%AA%B0%E0%AB%8D%E0%AA%9A%E0%AA%BE:Tsevener?markasread=245545&markasreadwiki=guwiki#c-Aniket-2022-05-03T16:16:00.000Z-સ્વાગત!",
"label": "સંદેશ જુઓ"
},
"secondary": [
{
"url": "https://gu.wikipedia.org/wiki/%E0%AA%B8%E0%AA%AD%E0%AB%8D%E0%AA%AF:New_user_message",
"label": "New user message",
"tooltip": "",
"description": "",
"icon": "userAvatar",
"prioritized": true
},
{
"url": "https://gu.wikipedia.org/w/index.php?title=%E0%AA%B8%E0%AA%AD%E0%AB%8D%E0%AA%AF%E0%AA%A8%E0%AB%80_%E0%AA%9A%E0%AA%B0%E0%AB%8D%E0%AA%9A%E0%AA%BE:Tsevener&oldid=prev&diff=819623",
"label": "ફેરફારો જુઓ",
"description": "",
"icon": "changes",
"prioritized": true
}
],
"legacyPrimary": {
"url": "//gu.wikipedia.org/wiki/%E0%AA%B8%E0%AA%AD%E0%AB%8D%E0%AA%AF%E0%AA%A8%E0%AB%80_%E0%AA%9A%E0%AA%B0%E0%AB%8D%E0%AA%9A%E0%AA%BE:Tsevener?markasread=245545&markasreadwiki=guwiki",
"label": "સંદેશ જુઓ"
}
},
"iconUrl": "/w/extensions/Echo/modules/icons/edit-user-talk-progressive.svg"
}
...
```
Hash signs within the topic titles are not encoded either:
#c-TSevener_(WMF)-2022-05-04T12:53:00.000Z-Test_adding_title_with_**#**_mark",
#Test_adding_title_with_**#**_mark",
```
...
"header": "TSevener (WMF) te dejó un mensaje en <strong>tu página de discusión</strong> en «<strong>Test adding title with # mark</strong>».",
"compactHeader": "TSevener (WMF) te dejó un mensaje en «<strong>Test adding title with # mark</strong>».",
"body": "asdf",
"icon": "edit-user-talk",
"links": {
"primary": {
"url": "https://es.wikipedia.org/wiki/Usuario_discusi%C3%B3n:Tsevener?markasread=45724720&markasreadwiki=eswiki#c-TSevener_(WMF)-2022-05-04T12:53:00.000Z-Test_adding_title_with_#_mark",
"label": "Ver mensaje"
},
"secondary": [
{
"url": "https://es.wikipedia.org/wiki/Usuario:TSevener_(WMF)",
"label": "TSevener (WMF)",
"tooltip": "",
"description": "",
"icon": "userAvatar",
"prioritized": true
},
{
"url": "https://es.wikipedia.org/w/index.php?title=Usuario_discusi%C3%B3n:Tsevener&oldid=prev&diff=143315311",
"label": "Ver cambios",
"description": "",
"icon": "changes",
"prioritized": true
}
],
"legacyPrimary": {
"url": "//es.wikipedia.org/wiki/Usuario_discusi%C3%B3n:Tsevener?markasread=45724720&markasreadwiki=eswiki#Test_adding_title_with_#_mark",
"label": "Ver mensaje"
}
}
...
```