feat(compass-web): persist compass web preferences using mms endpoints COMPASS-10869 - #8293
feat(compass-web): persist compass web preferences using mms endpoints COMPASS-10869#8293dkwncho wants to merge 6 commits into
Conversation
|
TODO: Remove the gating of collection creation in csfle.mts such that the AppPreferences collection will be created as desired. We got away with keeping it gated in prod just cause the collections already existed for the 4 og user data types. If we don't do this, turning on feature flag in prod will break things Backport COMPASS-10868 before merging this PR |
c3ab10e to
3a23631
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces Atlas-backed persistence for Compass Web preferences by leveraging the Atlas “userData” (MMS) endpoints, while keeping cloud-provided preference/feature-flag values authoritative.
Changes:
- Add a new
AtlasPreferencesStorageimplementation (and loader) to persist preferences via Atlas userData endpoints. - Wire Compass Web preference loading to optionally use Atlas persistence when
enableCompassWebSettingsis enabled. - Add/extend unit tests around persisted preference loading/saving and the new storage integration.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/compass-web/src/preferences.tsx | Integrates Atlas userData-backed storage into Compass Web preference loading. |
| packages/compass-web/src/preferences.spec.tsx | Adds tests for loading/saving Compass Web preferences via the MMS userData endpoint. |
| packages/compass-preferences-model/src/provider.ts | Re-exports new Atlas preferences storage APIs from the preferences model provider entrypoint. |
| packages/compass-preferences-model/src/preferences-atlas-storage.ts | Implements Atlas userData GET/PUT persistence and merge behavior for preferences. |
| packages/compass-preferences-model/src/preferences-atlas-storage.spec.ts | Adds unit tests for load and persistence semantics (merging, overrides, failure modes). |
| packages/compass-preferences-model/src/compass-web-preferences-access.ts | Allows injecting a PreferencesStorage into Compass Web preferences access. |
| packages/compass-preferences-model/src/compass-web-preferences-access.spec.ts | Tests injected storage behavior and sandbox semantics. |
| packages/atlas-service/src/provider.tsx | Exposes getAtlasConfig via the atlas-service provider for Compass Web usage. |
45c8d84 to
84d7f7e
Compare
nbbeeken
left a comment
There was a problem hiding this comment.
in packages/compass-generative-ai/src/atlas-ai-service.ts we check if AI features are enabled for the project, do the new user-settings override the project level settings?
| authenticatedFetch: (url, init) => | ||
| fetch(url, { | ||
| ...init, | ||
| headers: { ...defaultHeaders, ...init?.headers }, | ||
| credentials: 'include', | ||
| }), |
There was a problem hiding this comment.
If I'm not mistaken AtlasServiceLike was made so we could feed a stubbed implementation into user-data in a previous PR (or am I remembering a different x-Like type we made?) We need the real thing here, is it somehow not available?
60aba5b to
a5a56af
Compare
Description
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes