update to json/v2 - pocketbase collection errors :(

This commit is contained in:
henrygd
2025-08-20 20:13:01 -04:00
parent 7ba1f366ba
commit 47360c5bf1
15 changed files with 92 additions and 90 deletions

View File

@@ -4,7 +4,8 @@ import (
"beszel"
"beszel/internal/common"
"beszel/internal/entities/system"
"encoding/json"
"encoding/json/jsontext"
"encoding/json/v2"
"errors"
"fmt"
"io"
@@ -144,7 +145,7 @@ func (a *Agent) writeToSession(w io.Writer, stats *system.CombinedData, hubVersi
if hubVersion.GTE(beszel.MinVersionCbor) {
return cbor.NewEncoder(w).Encode(stats)
}
return json.NewEncoder(w).Encode(stats)
return json.MarshalEncode(jsontext.NewEncoder(w), stats)
}
// extractHubVersion extracts the beszel version from SSH client version string.