We are seeing an issue with the notification tray history endpoint where mention notifications sometimes return targetName as ”undefined”, which also causes the description field to read awkwardly (e.g., “UserX has mentioned you in a comment in undefined”)
Here’s an example payload from our environment:
{
"targetType": "comment",
"verb": "mention",
"targetName": "undefined",
"parentTargetType": "post",
"parentTargetId": "6862fd41020414d0a3f769d5",
"targetId": "68b8a91565078eda567a5637",
"actors": [{ "name": "TheWatchGuy" }],
"description": "TheWatchGuy has mentioned you in a comment in undefined."
}
For comparison, here’s a case where it works correctly
{
"targetType": "comment",
"verb": "mention",
"targetName": "Wrist Time",
"parentTargetType": "post",
"parentTargetId": "68a5d533de362aeea9ec6a01",
"targetId": "68b88fac65078eda56775163",
"actors": [{ "name": "MicroRotor7482" }],
"description": "MicroRotor7482 has mentioned you in a comment in Wrist Time."
}
Questions:
- Is
targetNamesupposed to always resolve to the post/community name for mention notifications? - is there a recommended workaround to ensure
descriptiondoesn’t come back with”undefined”?
Thanks in advance!