Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions backend/__tests__/unit/models/AttentionItem.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ describe('AttentionItem', () => {
const pod = new mongoose.Types.ObjectId();

it('keeps a recipient/source fact unique and persists source snapshots', async () => {
// The uniqueness this test asserts lives in an index, and Mongoose builds
// indexes in the background after the model is first used. Without waiting
// for the build, the duplicate insert below races the index and resolves
// instead of rejecting (main went red on exactly that, 2026-09-03).
await AttentionItem.syncIndexes();
await AttentionItem.create({
recipientUserId: recipient,
podId: pod,
Expand Down
Loading