refactor(client): drop the Settings.watch method#40495
Conversation
#40494 took the four obviously-non-reactive client callers of settings.watch (room types + account sidebar items) over to settings.peek. The remaining six callers in apps/meteor/app/utils/client/ and apps/meteor/app/ui-message/client/ are in the exact same shape: they run inside synchronous helper functions called from React render paths, not from Tracker.autorun, so the watch-flavoured "Tracker reactivity" never made it back into the UI tree. Switch them to settings.peek too: - app/utils/client/getRoomAvatarURL.ts (Accounts_RoomAvatarExternalProviderUrl) - app/utils/client/getURL.ts (CDN_PREFIX, Site_Url) - app/utils/client/lib/getUserPreference.ts (Accounts_Default_User_Preferences_${key} fallback) - app/utils/client/restrictions.ts (FileUpload_MediaTypeBlackList, FileUpload_MediaTypeWhiteList) - app/ui-message/client/messageBox/messageBoxFormatting.ts (Katex_Enabled) With every Settings.watch caller migrated, drop the method itself from client/lib/settings/settings.ts and stop importing meteor/watch from there. The bridge file lives on for now — meteor/user.ts (watchUserId / watchUser) is still consumed by meteor/overrides/userAndUsers.ts, which exits later with the rest of the overrides folder.
|
/jira ARCH-2116 |
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
💤 Files with no reviewable changes (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🧠 Learnings (3)📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
📚 Learning: 2026-02-26T19:25:44.063ZApplied to files:
📚 Learning: 2026-05-06T12:21:44.083ZApplied to files:
🔇 Additional comments (5)
WalkthroughSettings class removes the reactive ChangesSettings API Migration
🎯 2 (Simple) | ⏱️ ~10 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ 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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor/settings-watch-to-peek #40495 +/- ##
================================================================
Coverage 69.63% 69.63%
================================================================
Files 3318 3318
Lines 121972 121948 -24
Branches 21805 21786 -19
================================================================
- Hits 84931 84916 -15
+ Misses 33712 33710 -2
+ Partials 3329 3322 -7
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Summary
#40494 took the four obviously-non-reactive client callers of `settings.watch` (room types + account sidebar items) over to `settings.peek`. The remaining six callers in `apps/meteor/app/utils/client/` and `apps/meteor/app/ui-message/client/` are in the exact same shape: they run inside synchronous helper functions called from React render paths, not from `Tracker.autorun`, so the watch-flavoured "Tracker reactivity" never made it back into the UI tree. Switch them to `settings.peek` too:
With every `Settings.watch` caller migrated, drop the method itself from `client/lib/settings/settings.ts` and stop importing `meteor/watch` from there. The bridge file lives on for now — `meteor/user.ts` (`watchUserId` / `watchUser`) is still consumed by `meteor/overrides/userAndUsers.ts`, which exits later with the rest of the overrides folder.
Test plan
Task: ARCH-2144
Summary by CodeRabbit