fix(db): row-out repository reads bypass the identity map — stale write-back over nativeUpdate at flush; insertUser via em.insert; settings round-trip pinned

This commit is contained in:
jubnl
2026-09-22 20:32:35 +02:00
parent e9d0cb60e0
commit 8d0dddf385
21 changed files with 442 additions and 172 deletions
@@ -178,7 +178,7 @@ describe('applyPlatformUploads', () => {
res,
next,
);
expect(h.verifyJwtAndLoadUser).toHaveBeenCalledWith('jwt123', expect.anything());
expect(h.verifyJwtAndLoadUser).toHaveBeenCalledWith('jwt123', expect.objectContaining({ findByIdWithPasswordVersion: expect.any(Function) }));
expect(h.sendToResponse).toHaveBeenCalledWith('photos', 'a.jpg', res);
});
@@ -188,7 +188,7 @@ describe('applyPlatformUploads', () => {
h.verifyJwtAndLoadUser.mockReturnValue({ id: 1 });
const res = makeRes();
await photoHandler()({ params: { filename: 'a.jpg' }, headers: {}, query: { token: 'qtok' } }, res, next);
expect(h.verifyJwtAndLoadUser).toHaveBeenCalledWith('qtok', expect.anything());
expect(h.verifyJwtAndLoadUser).toHaveBeenCalledWith('qtok', expect.objectContaining({ findByIdWithPasswordVersion: expect.any(Function) }));
expect(h.sendToResponse).toHaveBeenCalledWith('photos', 'a.jpg', res);
});