You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix Settings Diamond Dependency and Top-Level Await Side-Effects between cached.ts and settings/index.ts聽#43048
A architectural anti-pattern and Diamond Dependency exists between apps/meteor/server/settings/cached.ts and apps/meteor/server/settings/index.ts.
Currently, consumer modules requiring read-only access to settings (e.g., settings.get()) import settings inconsistently across two competing paths:
apps/meteor/server/settings/cached.ts (lightweight, pure in-memory cache).
apps/meteor/server/settings/index.ts (barrel file re-exporting settings, but also invoking await initializeSettings() hitting MongoDB via top-level await).
This creates an accidental diamond dependency, delays module evaluation due to top-level await database queries, breaks unit testing in isolated environments, and introduces circular dependency hazards.
馃攳 Root Cause Analysis
Top-Level Await at Module Evaluation Time: apps/meteor/server/settings/index.ts executes:
Activity