-
Notifications
You must be signed in to change notification settings - Fork 11.6k
chore: ensure default selected calendars in calendars processor job #26944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ThyMinimalDev
wants to merge
5
commits into
main
Choose a base branch
from
ensure-default-destination-calendars-api-v2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+23
−24
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 2 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="apps/api/v2/src/ee/calendars/services/calendars.service.ts">
<violation number="1" location="apps/api/v2/src/ee/calendars/services/calendars.service.ts:54">
P2: `ensureDefaultSelectedCalendars` is ignored whenever cached data exists, because the method returns the cache before running the ensure-defaults logic. This prevents onboarding flows from actually ensuring defaults if the cache was already populated.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Contributor
Devin AI is addressing Cubic AI's review feedbackA Devin session has been created to address the issues identified by Cubic AI. |
When ensureDefaultSelectedCalendars is true, the cache should be bypassed to ensure the defaults logic actually runs. Previously, cached data would be returned before the ensure-defaults logic could execute. Addresses Cubic AI review feedback (confidence 9/10). Co-Authored-By: unknown <>
Contributor
E2E results are ready! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
This PR ensures that default selected calendars (in addition to destination calendars) are set when the calendars background job runs in API v2.
Previously, the
CalendarsProcessorcalledgetCalendars(userId)which only ensured default destination calendars were set. Now it passestruefor a newensureDefaultSelectedCalendarsparameter, which setsonboarding: truewhen callinggetConnectedDestinationCalendarsAndEnsureDefaultsInDbfrom platform libraries. This triggers the full onboarding behavior that also creates default selected calendars.The default value remains
falseto preserve existing behavior for other callers and caching.Updates since last revision
Fixed cache bypass logic: When
ensureDefaultSelectedCalendarsistrue, the method now correctly bypasses the cache to ensure the defaults logic actually runs. Previously, cached data would be returned before the ensure-defaults logic could execute, making the flag ineffective when cache was populated.Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
getCalendars(userId)(without the second parameter) still work as before and don't trigger the onboarding behaviorensureDefaultSelectedCalendars=true, the cache is bypassed and defaults are ensured even if cached data existsHuman Review Checklist
onboarding: trueis the correct flag to trigger default selected calendar creation ingetConnectedDestinationCalendarsAndEnsureDefaultsInDbensureDefaultSelectedCalendars=true, we intentionally skip the cache to ensure defaults are setensureDefaultSelectedCalendars=falseor omitted) still use the cache as expected