Skip to content

🔧 refactor: customUserVar Error Normalization - #8950

Merged
danny-avila merged 3 commits into
devfrom
fix/cuv-save-error
Aug 8, 2025
Merged

danny-avila merged 3 commits into
devfrom
fix/cuv-save-error

Conversation

@dustinhealy

@dustinhealy dustinhealy commented Aug 8, 2025 •

Copy link
Copy Markdown
Collaborator

Summary

This pull request normalizes error handling in updateUserPluginsController. It introduces a small helper to ensure a valid HTTP status and message are always returned (defaulting to 400 when missing), preventing the “Saving...” state from persisting when encountering errors (e.g., invalid CREDS_KEY length). Also updates a localization string which popped during these errors which had an unused template variable.

Related to Discussion #8916

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • Translation update

Testing

  • Configure an invalid CREDS_KEY (non-64 hex) to trigger an encryption error.
  • In the UI, save MCP customUserVars.
  • Confirm POST /api/user/plugins responds with 400 and an error message.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • Local unit tests pass with my changes

…is returned in UserController

- Ensures updateUserPluginsController always returns valid HTTP status codes instead of undefined
- Add normalizeHttpError() helper to safely extract status/message from errors
- Default to 400 status code when Error.status is undefined/invalid
@dustinhealy
dustinhealy marked this pull request as ready for review August 8, 2025 18:57
Comment thread api/server/controllers/UserController.js Outdated
@danny-avila danny-avila changed the title 🔧 fix: customUserVar Error Normalization 🔧 fix: customUserVar Error Normalization Aug 8, 2025
@danny-avila danny-avila changed the title 🔧 fix: customUserVar Error Normalization 🔧 refactor: customUserVar Error Normalization Aug 8, 2025
@danny-avila
danny-avila merged commit 9ca1847 into dev Aug 8, 2025
@danny-avila
danny-avila deleted the fix/cuv-save-error branch August 8, 2025 19:53
xycjscs pushed a commit to xycjscs/LibreChat that referenced this pull request Aug 9, 2025
* fix: localization string had unused template var

* fix: add normalizeHttpError to hopefully stop UI hangs when an error is returned in UserController

- Ensures updateUserPluginsController always returns valid HTTP status codes instead of undefined
- Add normalizeHttpError() helper to safely extract status/message from errors
- Default to 400 status code when Error.status is undefined/invalid

* refactor: move normalizeHttpError to packages/api
pedrojreis pushed a commit to nosportugal/LibreChat that referenced this pull request Sep 4, 2025
* fix: localization string had unused template var

* fix: add normalizeHttpError to hopefully stop UI hangs when an error is returned in UserController

- Ensures updateUserPluginsController always returns valid HTTP status codes instead of undefined
- Add normalizeHttpError() helper to safely extract status/message from errors
- Default to 400 status code when Error.status is undefined/invalid

* refactor: move normalizeHttpError to packages/api
Guiraud pushed a commit to Guiraud/LibreChat that referenced this pull request Nov 21, 2025
* fix: localization string had unused template var

* fix: add normalizeHttpError to hopefully stop UI hangs when an error is returned in UserController

- Ensures updateUserPluginsController always returns valid HTTP status codes instead of undefined
- Add normalizeHttpError() helper to safely extract status/message from errors
- Default to 400 status code when Error.status is undefined/invalid

* refactor: move normalizeHttpError to packages/api
patricksn3ll pushed a commit to patricksn3ll/LibreChat that referenced this pull request Dec 11, 2025
* fix: localization string had unused template var

* fix: add normalizeHttpError to hopefully stop UI hangs when an error is returned in UserController

- Ensures updateUserPluginsController always returns valid HTTP status codes instead of undefined
- Add normalizeHttpError() helper to safely extract status/message from errors
- Default to 400 status code when Error.status is undefined/invalid

* refactor: move normalizeHttpError to packages/api
jcbartle pushed a commit to jcbartle/LibreChat that referenced this pull request May 11, 2026
* fix: localization string had unused template var

* fix: add normalizeHttpError to hopefully stop UI hangs when an error is returned in UserController

- Ensures updateUserPluginsController always returns valid HTTP status codes instead of undefined
- Add normalizeHttpError() helper to safely extract status/message from errors
- Default to 400 status code when Error.status is undefined/invalid

* refactor: move normalizeHttpError to packages/api
ThomasVuNguyen pushed a commit to ThomasVuNguyen/LibreChat that referenced this pull request Jul 15, 2026
* fix: localization string had unused template var

* fix: add normalizeHttpError to hopefully stop UI hangs when an error is returned in UserController

- Ensures updateUserPluginsController always returns valid HTTP status codes instead of undefined
- Add normalizeHttpError() helper to safely extract status/message from errors
- Default to 400 status code when Error.status is undefined/invalid

* refactor: move normalizeHttpError to packages/api
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants