Skip to content

Bug Fixes and Improvements in Host Management #1758

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

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

x0sina
Copy link
Collaborator

@x0sina x0sina commented Apr 11, 2025

Bug Fixes and Improvements in Host Management

Bug Fixes

  1. Mux Protocol Handling

    • Fixed issue where protocol couldn't be set to "none" in Clash settings
    • Updated schema validation to properly handle "none" as a valid protocol option
    • Resolved type errors in form handling for protocol selection
  2. XUDP Proxy 443 Options

    • Corrected available options from ["none", "reject", "proxy"] to ["reject", "allow", "skip"]
    • Fixed form validation to properly handle the new option set
    • Ensured proper type safety in form value handling
  3. Form Data Handling

    • Fixed type error where string | undefined was being passed to string parameter
    • Improved form value management to ensure consistent data types
    • Removed unnecessary conditional logic that could cause type mismatches

Technical Implementation Details

Schema Updates

// Updated protocol enum in Hosts.tsx
protocol: z.enum(["none", "smux", "yamux", "h2mux"]).optional()

// Updated XUDP proxy 443 enum
xudp_proxy_443: z.enum(["reject", "allow", "skip"]).nullable().optional()

Form Handling Improvements

  • Simplified form value setting in HostModal component
  • Removed redundant type checks and conversions
  • Ensured consistent data types throughout the form submission process

Testing Requirements

  1. Protocol Selection

    • Verify that "none" can be selected as a protocol option
    • Confirm that protocol changes are properly saved
    • Check that existing configurations with "none" protocol work correctly
  2. XUDP Proxy 443

    • Test all three options: "reject", "allow", "skip"
    • Verify that form submission works with each option
    • Confirm that existing configurations are properly handled
  3. Form Submission

    • Test form submission with various combinations of settings
    • Verify that type errors are resolved
    • Confirm that all form fields maintain their values correctly

@x0sina x0sina added Frontend Bug Fix v1 feature or bug that need to be implement or be fixed in version 1 labels Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Frontend v1 feature or bug that need to be implement or be fixed in version 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant