mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-03 18:25:02 +08:00
fix: cleanup tmp while updating users inbox (#5559)
This commit is contained in:
parent
cf855bd48d
commit
1f085580e6
2 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -1046,6 +1046,7 @@ export async function updateInbox(
|
|||
inventory: "$tmp.inventory",
|
||||
},
|
||||
},
|
||||
{ $unset: "tmp" },
|
||||
]);
|
||||
|
||||
if (update.matchedCount !== 1)
|
||||
|
|
Loading…
Reference in a new issue