mizzkey/packages/backend/src
dakkar 417bb2d31e 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 421f8d49e5d7a8dc3a798cc54716c767df8be3cb)
2024-02-13 15:21:30 +09:00
..
@types update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00
boot update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00
core Never return broken notifications #409 2024-02-13 15:21:30 +09:00
daemons update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00
misc perf: omit search for immutable static requests (#13265) 2024-02-13 10:43:06 +09:00
models update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00
queue update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00
server perf: omit search for immutable static requests (#13265) 2024-02-13 10:43:06 +09:00
config.ts update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00
const.ts update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00
decorators.ts update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00
di-symbols.ts update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00
env.ts update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00
global.d.ts update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00
GlobalModule.ts update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00
logger.ts update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00
MainModule.ts update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00
NestLogger.ts update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00
postgres.ts update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00
types.ts update SPDX-FileCopyrightText 2024-02-12 11:37:45 +09:00