app Fix silent failure when domain.json has invalid icon#1507
Open
DSingh0304 wants to merge 1 commit intozulip:mainfrom
Open
app Fix silent failure when domain.json has invalid icon#1507DSingh0304 wants to merge 1 commit intozulip:mainfrom
DSingh0304 wants to merge 1 commit intozulip:mainfrom
Conversation
The Zod schema for server config entries required `icon` to be a non-empty string. If the field was missing or empty, schema parsing would throw, causing getDomains() to silently return an empty array. This left the user with the "Add Organization" screen and no way to connect to their configured servers. Give the `icon` field a safe default of `defaultIconSentinel` so that entries with missing icons still load correctly and fall back to the bundled default icon. Fixes zulip#1278.
Collaborator
Author
|
Ready for review! |
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.
Fixes: #1278
Description
This PR addresses a bug where a missing or malformed
iconfield in thedomain.jsonconfiguration file prevented the application from starting successfully.Root Cause: The Zod configuration schema required
iconto be a non-empty string. If this field was missing (common after manual configuration edits), the entire server list failed to parse in the renderer, causing the app to "hang" on a loading state without showing any configured servers.Technical Changes
serverConfigSchemainapp/renderer/js/utils/domain-util.tsto make theiconfield optional with a fallback todefaultIconSentinel.Screenshots and screen captures:

Platforms this PR was tested on:
Self-review checklist