Skip to content

Fix: Preserve externalId when updating Trigger.dev schedules#177

Merged
recoupableorg merged 1 commit intomainfrom
fix/trigger-schedule-external-id-preservation
Nov 23, 2025
Merged

Fix: Preserve externalId when updating Trigger.dev schedules#177
recoupableorg merged 1 commit intomainfrom
fix/trigger-schedule-external-id-preservation

Conversation

@recoupableorg
Copy link
Collaborator

@recoupableorg recoupableorg commented Nov 23, 2025

Prevents externalId from being cleared during task updates, which was causing scheduled tasks to fail. The updateSchedule function now includes externalId parameter to maintain consistency with schedule creation.

Summary by CodeRabbit

  • Bug Fixes
    • Schedule updates now properly preserve external identifier metadata during all modifications. Previously, external identifiers could be inadvertently cleared when updating trigger schedules. This fix ensures external identifiers remain intact and are maintained throughout the update process, preserving consistency and data integrity across your trigger management system.

✏️ Tip: You can customize this high-level summary in your review settings.

Prevents externalId from being cleared during task updates, which was causing scheduled tasks to fail. The updateSchedule function now includes externalId parameter to maintain consistency with schedule creation.
@coderabbitai
Copy link

coderabbitai bot commented Nov 23, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The changes add an externalId parameter to schedule update operations, enabling it to be passed from the sync trigger logic through the update schedule function to prevent the field from being cleared during updates.

Changes

Cohort / File(s) Change Summary
Schedule Update Enhancement
lib/trigger/syncTriggerSchedule.ts, lib/trigger/updateSchedule.ts
Added externalId: string to UpdateScheduleParams type definition. Updated updateSchedule call in sync trigger to pass externalId set to taskId, and threaded the parameter through to schedules.update call. Added clarifying comment explaining the field prevents clearing during updates.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify that externalId is correctly initialized with taskId in the sync trigger logic
  • Confirm the downstream schedules.update function properly accepts and handles the externalId parameter
  • Validate the rationale that including externalId prevents it from being unintentionally cleared during schedule updates

Poem

🐰 A field hops through the code so neat,
externalId won't face defeat,
From sync to update, it travels true,
No clearing here—we'll keep it through! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/trigger-schedule-external-id-preservation

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0f380cd and b01d349.

📒 Files selected for processing (2)
  • lib/trigger/syncTriggerSchedule.ts (1 hunks)
  • lib/trigger/updateSchedule.ts (1 hunks)

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@recoupableorg recoupableorg merged commit b10ef96 into main Nov 23, 2025
1 of 2 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.

2 participants