Merged
Conversation
…tings` to `{}` and persist the repaired document.
Contributor
There was a problem hiding this comment.
Pull request overview
Hardens per-user settings handling to prevent /chats from failing when a user’s Cosmos user-settings document has a malformed settings field, and adds regression coverage + documentation for the fix.
Changes:
- Normalize missing/malformed
user_settings["settings"]to{}inget_user_settings()and persist the repaired document with telemetry. - Make
/chatsread nested user settings via safe dict fallbacks. - Bump version and add functional test + fix documentation (and release notes entry).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| functional_tests/test_chats_user_settings_hardening_fix.py | Adds a functional regression test covering missing/non-dict settings repair + persistence. |
| docs/explanation/release_notes.md | Adds a v0.238.025 bug-fix entry describing the hardening and telemetry. |
| docs/explanation/fixes/CHATS_USER_SETTINGS_HARDENING_FIX.md | Adds fix documentation with root cause, implementation details, and validation references. |
| application/single_app/route_frontend_chats.py | Uses a safe user_settings_dict when reading activeGroupOid / activePublicWorkspaceOid; moves user_id guard earlier. |
| application/single_app/functions_settings.py | Repairs malformed/missing settings to {}, logs repair telemetry, and upserts repaired user document. |
| application/single_app/config.py | Updates VERSION to 0.238.025. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/chatsdue to malformed per-user settings data.user_settings["settings"]was always a dictionary. If that field existed but had an invalid type (for example string, null, or list), the page could fail before rendering.get_user_settings()to normalize missing/malformedsettingsto{}and persist the repaired document. Hardened the chats route to use safe dictionary fallbacks when reading nested settings values.[UserSettings] Malformed settings repaired) to improve diagnostics for future user-specific data-shape issues.functions_settings.py,route_frontend_chats.py,config.py.test_chats_user_settings_hardening_fix.py,CHATS_USER_SETTINGS_HARDENING_FIX.md./chatsroute resilience,functional_tests/test_chats_user_settings_hardening_fix.py,docs/explanation/fixes/CHATS_USER_SETTINGS_HARDENING_FIX.md)