From 9fc2a4031f2cd829e6b36c39fab8af964004b000 Mon Sep 17 00:00:00 2001 From: Alex Vydrin Date: Fri, 24 Apr 2026 10:52:44 +0200 Subject: [PATCH] Fix double callback bug in allocations-dao update method The error callback on line 53 ran unconditionally after allocationsCol.update(), causing a double callback when the update succeeded: once immediately (with null, null) and again when getUserById completed. Wrap the error callback in an else branch so it only fires when there IS an error. Made-with: Cursor --- app/data/allocations-dao.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/data/allocations-dao.js b/app/data/allocations-dao.js index 24d4718c4a..01cfefe65b 100644 --- a/app/data/allocations-dao.js +++ b/app/data/allocations-dao.js @@ -48,9 +48,9 @@ const AllocationsDAO = function(db){ return callback(null, allocations); }); + } else { + return callback(err, null); } - - return callback(err, null); }); };