-
Notifications
You must be signed in to change notification settings - Fork 11.8k
chore: deprecates dbWatchers and set default value to false #35981
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
chore: deprecates dbWatchers and set default value to false #35981
Conversation
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: 93dcbbd The changes in this PR will be included in the next version bump. This PR includes changesets to release 36 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
export const dbWatchersDisabled = | ||
(process.env.NODE_ENV === 'production' && ['yes', 'true'].includes(disabledEnvVar)) || | ||
(process.env.NODE_ENV !== 'production' && !['no', 'false'].includes(disabledEnvVar)); | ||
export const dbWatchersDisabled = !['no', 'false'].includes(disabledEnvVar); |
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.
// By default, DB watchers are disabled unless DISABLE_DB_WATCHERS is 'no' or 'false'.
// Note: This changes previous behavior where, in production, watchers could be enabled
// by default if DISABLE_DB_WATCHERS was not 'yes' or 'true'.
export const dbWatchersDisabled = !['no', 'false'].includes(disabledEnvVar);
The updated logic for dbWatchersDisabled
changes the default behavior in production environments. Previously, if DISABLE_DB_WATCHERS
was unset or not 'yes'/'true', watchers were enabled in production. With the new logic, if DISABLE_DB_WATCHERS
is not 'no' or 'false' (e.g., it's unset), watchers will be disabled. This shift to 'disabled by default' in such production scenarios could lead to unexpected behavior if parts of the system rely on the old default. Please verify this change is intended and its impact is fully understood. Consider adding a comment to clarify the new default behavior and its difference from the past.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
9332fbf
to
3cc40ed
Compare
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
@@ -531,7 +531,7 @@ jobs: | |||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |||
REPORTER_JIRA_ROCKETCHAT_API_KEY: ${{ secrets.REPORTER_JIRA_ROCKETCHAT_API_KEY }} | |||
|
|||
test-ui-ee-no-watcher: | |||
test-ui-ee-watcher: |
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.
test-ui-ee-watcher:
The job test-ui-ee-no-watcher
has been renamed to test-ui-ee-watcher
on line 534. This requires updating all references to this job's results throughout the workflow. Specifically, the tests-done
job's script (around line 600 in the full file, not shown in the provided diff) appears to still reference ${{ needs.test-ui-ee-no-watcher.result }}
. This reference must be changed to ${{ needs.test-ui-ee-watcher.result }}
to prevent runtime errors when the workflow attempts to access the result of a dependency that no longer exists under that name in its needs
context.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
|
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #35981 +/- ##
===========================================
+ Coverage 64.66% 64.72% +0.06%
===========================================
Files 3244 3247 +3
Lines 95397 95433 +36
Branches 17852 17904 +52
===========================================
+ Hits 61684 61768 +84
+ Misses 30819 30762 -57
- Partials 2894 2903 +9
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Co-authored-by: Diego Sampaio <[email protected]>
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
https://rocketchat.atlassian.net/browse/ARCH-1602
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Further comments
This pull request updates the Rocket.Chat repository by modifying the default behavior of database watchers. The changes are made in the
packages/models/src/index.ts
file. The logic is adjusted so that database watchers are now disabled by default in more scenarios, particularly in production environments where theDISABLE_DB_WATCHERS
environment variable is not set or is not explicitly set to 'no' or 'false'. Additionally, a console warning is introduced to alert users when watchers are active, highlighting their deprecation. The source branch for this change ischore/deprecate-streamhub-oplog-changestreams
, and it targets thedevelop
branch.