Skip to content

Issue #753: add task-dedup unit tests#756

Merged
hubertciebiada merged 1 commit into
mainfrom
test/753-task-dedup-tests
May 27, 2026
Merged

Issue #753: add task-dedup unit tests#756
hubertciebiada merged 1 commit into
mainfrom
test/753-task-dedup-tests

Conversation

@hubertciebiada
Copy link
Copy Markdown
Owner

Closes #753

Summary

Adds tests/server/services/task-dedup.test.ts with 8 unit tests covering all documented invariants of src/server/services/task-dedup.ts:

  • default-not-seen, record-then-seen, idempotent-record
  • per-team isolation
  • per-team clear (clearHookTaskIdsForTeam)
  • FIFO cap eviction at MAX_TASK_IDS_PER_TEAM = 256 (inserts MAX+1, verifies oldest evicted, all 256 most-recent retained)
  • global reset (resetTaskDedupState)

Pure in-memory unit tests, no DB / SSE / mocks. Top-level beforeEach(resetTaskDedupState) isolates module-level Map state.

Test plan

  • npx vitest run tests/server/services/task-dedup.test.ts --project=server → 8/8 passed in 10ms
  • npx tsc --noEmit clean
  • No edits to production module (git diff origin/main..HEAD -- src/ empty)

@hubertciebiada hubertciebiada enabled auto-merge (squash) May 27, 2026 09:27
@hubertciebiada hubertciebiada merged commit 62e8584 into main May 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests: cover task-dedup module (hook vs stream-event dedup)

1 participant