mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 05:43:09 +02:00
5f43c2faa2
* Never return broken notifications #409
Since notifications are stored in Redis, we can't expect relational
integrity: deleting a user will *not* delete notifications that
mention it.
But if we return notifications with missing bits (a `follow` without a
`user`, for example), the frontend will get very confused and throw an
exception while trying to render them.
This change makes sure we never expose those broken notifications. For
uniformity, I've applied the same logic to notes and roles mentioned
in notifications, even if nobody reported breakage in those cases.
Tested by creating a few types of notifications with a `notifierId`,
then deleting their user.
(cherry picked from commit
|
||
---|---|---|
.. | ||
2fa.ts | ||
antennas.ts | ||
api-visibility.ts | ||
api.ts | ||
block.ts | ||
clips.ts | ||
drive.ts | ||
endpoints.ts | ||
exports.ts | ||
fetch-resource.ts | ||
fetch-validate-ap-deny.ts | ||
ff-visibility.ts | ||
move.ts | ||
mute.ts | ||
nodeinfo.ts | ||
note.ts | ||
oauth.ts | ||
renote-mute.ts | ||
streaming.ts | ||
thread-mute.ts | ||
timelines.ts | ||
user-notes.ts | ||
users.ts | ||
well-known.ts |