Repository navigation
Fix web notice punctuation and unexpected request errors - #78
Merged
Merged
Conversation
The static "7 records" placeholder showed a wrong count until the catalog script ran. Leave it empty; app.ts fills in the real count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Server error messages already end with a full stop, so templates such as
'{0}。未提交内容已保留。' rendered "。。" (".." in English). A new clause()
helper drops the message's closing punctuation before it is inserted.
Unexpected errors in the request handler returned a generic 500 without
any trace. They are now logged as [web_request_failed] with the method,
the path without its query string, share tokens redacted, and the stack.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A path such as /%E0%A4%A made decodeURIComponent throw a URIError in the static file handler and in API routes that decode their segments, which the server answered with 500. The request entry now checks the path once and answers 400 "访问地址无效。". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
{0}。未提交内容已保留。rendered。。(..in English). The newclause()helper inapps/web/i18n.tsdrops the closing punctuation first. Used by the connection notices inapp.tsand the failed source check insourceCheck.tsx.[web_request_failed] METHOD /pathwith the stack trace. The query string is dropped and/api/share/<token>is written as/api/share/:token./%E0%A4%AmadedecodeURIComponentthrow a URIError, and the server answered 500. The request entry now checks the path once and returns 400访问地址无效。.Verification
bun run typecheck:webandbun run build:webpass.tests/webServer.test.ts,tests/webStaticFiles.test.tsandtests/webI18nScanner.test.tspass.tests/webI18n.test.tshas 2 failures, and they fail onmaintoo, with unused dictionary entries for formalization messages./,/api/sessionand missing files return 200 and 404 as before.🤖 Generated with Claude Code