Skip to content

Test/vault expiry windows#922

Merged
1nonlypiece merged 7 commits into
Disciplr-Org:mainfrom
harryjupiter148:test/vault-expiry-windows
Jun 28, 2026
Merged

Test/vault expiry windows#922
1nonlypiece merged 7 commits into
Disciplr-Org:mainfrom
harryjupiter148:test/vault-expiry-windows

Conversation

@harryjupiter148

Copy link
Copy Markdown
Contributor

Summary

Adds comprehensive unit tests in src/tests/vaultExpiry.windows.test.ts to validate deadline-window boundary selection, UTC timestamp parsing, DST transitions, and idempotency deduplication for sendMilestoneReminders. Also fixes mock evaluation in src/tests/vaultExpiry.reminders.test.ts.

Key Verification Points Covered:

  • Window Edge Selection: Asserts milestones at exact upper edges (timeUntilDue === leadTimeMs) and inside lower boundaries (timeUntilDue === 1ms) are included, while exact deadline hits (timeUntilDue === 0ms), overdue items, and outside upper edges (timeUntilDue === leadTimeMs + 1ms) are excluded.
  • UTC Alignment: Verifies normalized UTC timestamps against docs/TIMEZONE_CONTRACT.md guidelines and sub-second precision.
  • DST Handling: Ensures spring-forward and fall-back transitions maintain deterministic UTC millisecond durations without 1-hour window drift.
  • Already-Reminded Exclusion: Validates idempotency key formatting (milestone-reminder-{id}-{leadTimeMs}) and database unique constraint collision handling.

Type of change

  • Bug fix
  • New feature/functionality
  • Refactor (no functional change)
  • Documentation only
  • Contract storage/upgrade change

Related Issues

Closes #869

Comment thread src/routes/exports.ts
res.send(job.result)
})

router.get('/:id/download', authenticate, async (req: AuthenticatedRequest, res: Response) => {

@1nonlypiece 1nonlypiece left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solid, merged.

@1nonlypiece 1nonlypiece merged commit 7427ab2 into Disciplr-Org:main Jun 28, 2026
1 of 4 checks 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.

Add vaultExpiry service deadline-window selection and timezone tests in src/tests/vaultExpiry.windows.test.ts

3 participants