fix(dashboard): add missing unit-test for validate proxy before account creation#92
Closed
smeinecke wants to merge 2 commits intodwgx:masterfrom
Closed
fix(dashboard): add missing unit-test for validate proxy before account creation#92smeinecke wants to merge 2 commits intodwgx:masterfrom
smeinecke wants to merge 2 commits intodwgx:masterfrom
Conversation
…flow
Reorder POST /accounts validation - parseProxyUrl + host checks (validateHostFormat vs assertPublicUrlHost per ALLOW_PRIVATE_PROXY_HOSTS) now run before addAccountByKey/addAccountByToken. Prevents orphaned accounts on proxy validation failure. Gate ensureLsForAccount + probeAccount behind !isTestEnv. Frontend: centralize error i18n via App.translateError(code, fallback) - replaces 6 inline `error.${err.message}` lookups.
Contributor
Author
|
Whops, you already fixed this in main :D |
…ounts Move api_key/token presence check to top of POST /accounts handler - runs before proxy validation + account creation. Prevents proxy network checks when credentials are missing. Simplify account creation to ternary expression (api_key vs token path). No functional change to validation order from dwgx#90 (proxy still validated before account creation).
Owner
|
@smeinecke 谢谢这个 PR,i18n 那部分真的很赞——我把 测试那部分(
总之 i18n refactor 已经在 v2.0.32 里了,谢谢这个 cleanup! |
dwgx
added a commit
that referenced
this pull request
Apr 29, 2026
… sanitizer (#86 follow-up) Two independent fixes bundled: 1. Dashboard error i18n centralization (cherry-picked from PR #92 by @smeinecke) - Adds App.translateError(code, fallbackKey) helper - Replaces 6 inline `error.${err.message}` lookups with a single helper - Same behavior, less duplication; future server error codes only need to be added in one place 2. Windows-style workspace path sanitization (#86 follow-up) oaskdosakdoakd reported `C:\home\user\projects\workspace-devinxse` leaking despite the existing Unix-only regex catching the matching `/home/user/projects/workspace-skxwsx01` form. GLM running on Windows clients hallucinates Windows-prefixed forms of the workspace path. Defensive coverage: - C:\home\user\projects\workspace-x (Windows backslash + drive prefix) - \home\user\projects\workspace-x (Windows backslash, no drive) - C:\home/user/projects/workspace-x (mixed separators) - d:\... lowercase drive Path body char class also extended to keep matching across backslash tails (previously the first `\` would terminate the match and leave the path tail visible).
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.
改了什么 / What changed
Added test/account-add-proxy.test.js with coverage for:
Frontend:
error.${err.message}lookups.为什么 / Why
As mentioned in #90 (review) we need to validate the proxy before adding the account.
Checklist