chore: ensure default calendars with trigger.dev apiv2 #27058
+457
−284
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Ensures default calendars are created for organization users via the new CalendarsTasker in API v2. Uses Trigger.dev when async tasking is enabled (
enableAsyncTaskerconfig), and falls back to Bull queue with idempotent jobs when disabled.Link to Devin run: https://app.devin.ai/sessions/71826d8b4e2d4185b532187371bfdc28
Requested by: morgan@cal.com (@ThyMinimalDev)
Updates since last revision
Added comprehensive test coverage for the CalendarsTasker integration:
ensureDefaultCalendarsForUserwhenenableAsyncTaskeris trueensureDefaultCalendarsForUseris called when creating organization membership**/*.spec.tsto biome test file exceptions fornoExcessiveLinesPerFunctionruleMandatory Tasks (DO NOT REMOVE)
How should this be tested?
Unit tests: Run from
apps/api/v2directory:TZ=UTC npx jest --testPathPattern="organizations-delegation-credential.service.spec.ts"Expected: All 17 tests pass (13 existing + 4 new async tasker tests)
E2E test: The new test verifies the service method is called when creating a membership via the API
Manual testing:
enableAsyncTasker: truein configensureDefaultCalendarsjob with idempotency keyHuman Review Checklist
CalendarsTasker.dispatchcall signature matches the actual service interface${DEFAULT_CALENDARS_JOB}_${userId}) is correctfinallyblock properly removes test data**/*.spec.tsdoesn't have unintended side effects on other spec filesChecklist
Summary by cubic
Ensures default calendars are created for organization users via the new CalendarsTasker in API v2. Uses Trigger.dev when async tasking is enabled, and falls back to Bull with idempotent jobs.
New Features
Dependencies
Written for commit 820b7c6. Summary will update on new commits.