fix: cleanup tmp while updating users inbox (#5559)

This commit is contained in:
Christian Fehmer 2024-07-04 18:35:52 +02:00 committed by GitHub
parent cf855bd48d
commit 1f085580e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -936,7 +936,10 @@ describe("UserDal", () => {
);
//THEN
const { xp, inbox } = await UserDAL.getUser(user.uid, "");
const read = await UserDAL.getUser(user.uid, "");
expect(read).not.toHaveProperty("tmp");
const { xp, inbox } = read;
expect(xp).toEqual(3100);
//inbox is sorted by timestamp

View file

@ -1046,6 +1046,7 @@ export async function updateInbox(
inventory: "$tmp.inventory",
},
},
{ $unset: "tmp" },
]);
if (update.matchedCount !== 1)