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

@@ -5,7 +5,8 @@ import (
"beszel/internal/entities/system"
"beszel/internal/hub/ws"
"context"
"encoding/json"
"encoding/json/jsontext"
"encoding/json/v2"
"errors"
"fmt"
"math/rand"
@@ -275,7 +276,7 @@ func (sys *System) fetchDataViaSSH() (*system.CombinedData, error) {
if sys.agentVersion.GTE(beszel.MinVersionCbor) {
err = cbor.NewDecoder(stdout).Decode(sys.data)
} else {
err = json.NewDecoder(stdout).Decode(sys.data)
err = json.UnmarshalDecode(jsontext.NewDecoder(stdout), sys.data)
}
if err != nil {