fix: XMuxSettings camelCase deserialization (xMux lost in VLESS links)#589
fix: XMuxSettings camelCase deserialization (xMux lost in VLESS links)#589Ieqzya wants to merge 1 commit into
Conversation
serialization_alias in Pydantic v2 only affects output (model_dump),
not input parsing. When JSON from DB comes with camelCase keys
(maxConcurrency vs max_concurrency), the field silently resolves to None.
This breaks xmux in VLESS subscription links — xmux is parsed as None,
model_dump(exclude_none=True) returns {}, and _normalize_and_remove_none_values
strips the empty dict, removing xmux from the 'extra' parameter entirely.
Replace serialization_alias with alias, which in Pydantic v2 is used
for both validation and serialization, fixing the round-trip.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis PR updates the ChangesXMuxSettings Field Aliasing
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
XMux settings in hosts.transport_settings silently lost. extra parameter in VLESS links never contains xmux.
Root Cause
serialization_alias in Pydantic v2 only affects output, not input. JSON camelCase keys not mapped to snake_case fields.
Fix
Replace serialization_alias with alias in XMuxSettings (6 fields).
Verification
Before: XMuxSettings({maxConcurrency: 8}).max_concurrency -> None
After: XMuxSettings({maxConcurrency: 8}).max_concurrency -> 8
Summary by CodeRabbit