fix: convert anytls padding_scheme array to string for node compatibility#811
Open
onesyue wants to merge 1 commit intocedar2025:masterfrom
Open
fix: convert anytls padding_scheme array to string for node compatibility#811onesyue wants to merge 1 commit intocedar2025:masterfrom
onesyue wants to merge 1 commit intocedar2025:masterfrom
Conversation
…lity
The panel stores padding_scheme as a PHP array in PROTOCOL_CONFIGURATIONS
and always injects it into the API response via buildNodeConfig(). However,
xboard-node (Go) expects padding_scheme as type `panel.StringOrArray`, and
mapstructure cannot decode `[]interface{}` (JSON array) into this custom type,
causing "poll config failed" errors on all anytls nodes.
Convert the array to a newline-delimited string before sending to the node,
which StringOrArray can correctly parse.
Co-Authored-By: Claude Opus 4.6 <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
buildNodeConfig()sendspadding_schemeas a PHP array, which serializes to a JSON array (["stop=8","0=30-30",...])padding_schemeaspanel.StringOrArray, but mapstructure cannot decode[]interface{}into this custom type'padding_scheme' expected type 'panel.StringOrArray', got unconvertible type '[]interface {}'Fix
Convert the array to a
\n-delimited string before returning to the node.StringOrArrayhandles plain strings correctly.Test plan
padding_schemedecode errors in node logs after fixpadding_schemein DB and nodes using the default both work correctly🤖 Generated with Claude Code