Skip to content

chore(cron): Align cron job identifier in userDataDownloads#39261

Merged
dionisio-bot[bot] merged 2 commits intoRocketChat:developfrom
Jeet-Patil:fix/user-data-download-cron-identifier
Mar 3, 2026
Merged

chore(cron): Align cron job identifier in userDataDownloads#39261
dionisio-bot[bot] merged 2 commits intoRocketChat:developfrom
Jeet-Patil:fix/user-data-download-cron-identifier

Conversation

@Jeet-Patil
Copy link
Contributor

@Jeet-Patil Jeet-Patil commented Mar 2, 2026

Proposed changes (including videos or screenshots)

Aligned the identifier used in cronJobs.add() and cronJobs.remove() in apps/meteor/server/cron/userDataDownloads.ts.

Previously:

  • Job was added using "UserDataDownload"
  • Job was removed using "Generate download files for user data"

This mismatch prevented proper removal of the scheduled job when the Disable Data Exporter Processor setting was enabled.
The fix ensures both operations use the same identifier.

Issue(s)

When the Disable Data Exporter Processor setting is enabled:

  • The UI updates correctly (export option is removed).
  • However, the cron job remains scheduled in MongoDB.
  • The job continues executing every 2 minutes despite being disabled.
    This happens because cronJobs.remove() is called with a different identifier than the one used during cronJobs.add().

Steps to test or reproduce

  1. Ensure the Disable Data Exporter Processor setting is disabled (processor active).
  2. Verify that the job appears in the MongoDB collection.
  3. Enable the setting.
  4. Observe that:
    • The UI updates correctly.
    • The cron job remains scheduled and continues running.
      After applying this fix:
  5. Enable the setting again.
  6. Confirm that the scheduled job is properly removed from MongoDB.

Further comments

  • Verified locally that aligning the identifier resolves the issue.
  • This change does not modify job schema or scheduling behavior.
  • It does not introduce backward compatibility issues, as the job is already created using "UserDataDownload".

Summary by CodeRabbit

  • Refactor
    • Improved internal handling of background job scheduling and removal to ensure more reliable cron job lifecycle management.

@Jeet-Patil Jeet-Patil requested a review from a team as a code owner March 2, 2026 20:54
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Mar 2, 2026

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Mar 2, 2026

⚠️ No Changeset found

Latest commit: 02e1b50

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@CLAassistant
Copy link

CLAassistant commented Mar 2, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 2, 2026

Walkthrough

The change modifies the cron job scheduling and removal logic in userDataDownloads.ts to use jobName variable instead of name for registering and unregistering the scheduled job, affecting two lines of code.

Changes

Cohort / File(s) Summary
Cron Job Variable Reference
apps/meteor/server/cron/userDataDownloads.ts
Updated variable references from name to jobName in cron job scheduling and removal operations.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

type: bug

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately reflects the main change: aligning the cron job identifier in userDataDownloads from inconsistent 'name' and 'jobName' usage.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@Jeet-Patil Jeet-Patil changed the title Fix: Align cron job identifier in userDataDownloads fix(cron): Align cron job identifier in userDataDownloads Mar 2, 2026
@KevLehman KevLehman added the stat: QA assured Means it has been tested and approved by a company insider label Mar 3, 2026
@KevLehman KevLehman added this to the 8.3.0 milestone Mar 3, 2026
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Mar 3, 2026
@dionisio-bot dionisio-bot bot added this pull request to the merge queue Mar 3, 2026
@KevLehman KevLehman changed the title fix(cron): Align cron job identifier in userDataDownloads chore(cron): Align cron job identifier in userDataDownloads Mar 3, 2026
@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.86%. Comparing base (2c23512) to head (02e1b50).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #39261   +/-   ##
========================================
  Coverage    70.85%   70.86%           
========================================
  Files         3208     3208           
  Lines       113426   113425    -1     
  Branches     20530    20506   -24     
========================================
+ Hits         80368    80378   +10     
+ Misses       31013    31003   -10     
+ Partials      2045     2044    -1     
Flag Coverage Δ
e2e 60.33% <ø> (-0.03%) ⬇️
e2e-api 47.80% <100.00%> (-0.03%) ⬇️
unit 71.58% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 3, 2026
@KevLehman KevLehman modified the milestone: 8.3.0 Mar 3, 2026
@dionisio-bot dionisio-bot bot added stat: ready to merge PR tested and approved waiting for merge and removed stat: ready to merge PR tested and approved waiting for merge labels Mar 3, 2026
@dionisio-bot dionisio-bot bot added this pull request to the merge queue Mar 3, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 3, 2026
@KevLehman KevLehman modified the milestone: 8.3.0 Mar 3, 2026
@dionisio-bot dionisio-bot bot added stat: ready to merge PR tested and approved waiting for merge and removed stat: ready to merge PR tested and approved waiting for merge labels Mar 3, 2026
@dionisio-bot dionisio-bot bot added this pull request to the merge queue Mar 3, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 3, 2026
@KevLehman KevLehman modified the milestone: 8.3.0 Mar 3, 2026
@dionisio-bot dionisio-bot bot added stat: ready to merge PR tested and approved waiting for merge and removed stat: ready to merge PR tested and approved waiting for merge labels Mar 3, 2026
@dionisio-bot dionisio-bot bot added this pull request to the merge queue Mar 3, 2026
Merged via the queue into RocketChat:develop with commit 0d00b05 Mar 3, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants