gui: Keep short deviceID length consistent + xrefs (fixes #9313) (#9314)

Making short deviceID length consistent and referencing to protocol file
for future-proof edits. Closes #9313.
This commit is contained in:
Peter Badida
2024-01-02 17:31:57 +01:00
committed by GitHub
parent 86a08eb87d
commit 2abfefc18c
6 changed files with 12 additions and 6 deletions
+2 -1
View File
@@ -14,7 +14,8 @@ import (
)
const (
DeviceIDLength = 32
DeviceIDLength = 32
// keep consistent with shortIDStringLength in gui/default/syncthing/app.js
ShortIDStringLength = 7
)
+1
View File
@@ -84,6 +84,7 @@ func TestShortIDString(t *testing.T) {
id, _ := DeviceIDFromString(formatted)
sid := id.Short().String()
// keep consistent with ShortIDStringLength in lib/protocol/deviceid.go
if len(sid) != 7 {
t.Errorf("Wrong length for short ID: got %d, want 7", len(sid))
}