From d60b75adf477e8e8bbb2875588c49472d78fe213 Mon Sep 17 00:00:00 2001 From: 0xsysr3ll <0xsysr3ll@pm.me> Date: Mon, 8 Dec 2025 21:39:49 +0100 Subject: [PATCH] refactor(webpush): remove redundant checks Signed-off-by: 0xsysr3ll <0xsysr3ll@pm.me> --- server/routes/user/index.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/server/routes/user/index.ts b/server/routes/user/index.ts index af30223f3..107327bc1 100644 --- a/server/routes/user/index.ts +++ b/server/routes/user/index.ts @@ -189,21 +189,6 @@ router.post< } >('/registerPushSubscription', async (req, res, next) => { try { - const userPushSubRepository = getRepository(UserPushSubscription); - - const existingByAuth = await userPushSubRepository.findOne({ - relations: { user: true }, - where: { auth: req.body.auth, user: { id: req.user?.id } }, - }); - - if (existingByAuth) { - logger.debug( - 'User push subscription already exists. Skipping registration.', - { label: 'API' } - ); - return res.status(204).send(); - } - // This prevents race conditions where two requests both pass the checks await dataSource.transaction( async (transactionalEntityManager: EntityManager) => {