Repository navigation
fix: simple application error dispaly #7779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review of the diff
The change is small and mostly reasonable, but there are a few things worth flagging.
1. Unused
nullfallback onJSON.stringifyJSON.stringifyonly returnsundefinedwhen the input isundefined, a function, or a symbol — all of which are already excluded by the earliertypeofchecks (or byvalue == null). Realistically this?? ''is dead code. It's harmless but can be simplified:2. Behavior change for string values isn't validated
If the backend previously returned a string like
"{}"(common serialized empty object), you'd now render"{}"in the editor instead of an empty string, whereas the object branch treats{}as unconfigured. This asymmetry could cause UX inconsistency depending on whether the backend sends a stringified or structured value. Consider normalizing string content too, e.g.:Only do this if you're confident about the backend contract.
3. Non-plain objects
typeof value === 'object' && !Array.isArray(value)still passes forDate,Map, etc. Not an issue if the backend always sends plain JSON, but if you want to be strict:4. Comment language mismatch
The new JSDoc is in Chinese while surrounding types (
LongTermSettingData,SelectedKnowledge,ApplicationSettings) are English naming. Minor style inconsistency — align with repo conventions.5. No type guard input schema
detail.mcp_serversappears typed as possibly-stringalready (given?? ''before). If so,normalizeMcpServersis widening the actual runtime handling beyond what the type promises. That's fine defensively, but update the type ofmcp_serversif it can actually beunknown | objectat runtime — otherwise downstream code that assumes a string may still break.6. Missing test for
nullThe function handles
null/undefinedviavalue == null, but there's no explicit test shown. Please ensure unit tests cover:null,undefined,'', plain string,{},{a:1}, array, and primitive number/bool (which will hitJSON.stringify(123)→"123"— is that desired?). A primitive liketruebecoming"true"may be an unexpected pass-through — consider rejecting primitives other than string explicitly.Suggested consolidated version
This drops the dead
?? '', ignores non-object primitives, and keeps the empty-object rule. Verify behavior with your existing consumers before adopting.