fix(db): version vector serialisation :( (#10050)

ffs
This commit is contained in:
Jakob Borg
2025-04-09 17:46:49 +02:00
committed by GitHub
parent 7cfa871d58
commit ddea2e449c
4 changed files with 91 additions and 1 deletions
+7
View File
@@ -7,9 +7,11 @@
package sqlite
import (
"cmp"
"database/sql/driver"
"errors"
"iter"
"slices"
"github.com/jmoiron/sqlx"
"github.com/syncthing/syncthing/internal/gen/bep"
@@ -71,6 +73,11 @@ func (v *dbVector) Scan(value any) error {
if err != nil {
return wrap(err)
}
// This is only necessary because I messed up counter serialisation and
// thereby ordering in 2.0.0 betas, and can be removed in the future.
slices.SortFunc(vec.Counters, func(a, b protocol.Counter) int { return cmp.Compare(a.ID, b.ID) })
v.Vector = vec
return nil