diff --git a/pkg/service/stockholm/bridge.go b/pkg/service/stockholm/bridge.go index b758a13..de05415 100644 --- a/pkg/service/stockholm/bridge.go +++ b/pkg/service/stockholm/bridge.go @@ -140,7 +140,7 @@ func (b *Bridge) dispatch(clientID string, req appSendRequest) { val := b.state.Get("constant." + name) if val == "" && name == "kilo" { - val = "a7928d7b43dcd49f0af31e5aeed26458" + val = kiloDefaultValue } b.enqueueResult(clientID, id, val, "") diff --git a/pkg/service/stockholm/state.go b/pkg/service/stockholm/state.go index d431a04..6c46f3d 100644 --- a/pkg/service/stockholm/state.go +++ b/pkg/service/stockholm/state.go @@ -65,9 +65,8 @@ func (s *NativeState) SeedFromEnv(cfg *Config) { updates["margeAccountID"] = v } - // Default constant if s.Get("constant.kilo") == "" { - updates["constant.kilo"] = "a7928d7b43dcd49f0af31e5aeed26458" + updates["constant.kilo"] = kiloDefaultValue } // First-run defaults that require a persisted value diff --git a/pkg/service/stockholm/util.go b/pkg/service/stockholm/util.go index a5f550b..9a08f69 100644 --- a/pkg/service/stockholm/util.go +++ b/pkg/service/stockholm/util.go @@ -5,6 +5,15 @@ import ( "encoding/hex" ) +// kiloDefaultValue is the published default for the Stockholm "kilo" +// constant, carried over from the upstream krahl/soundcork-stockholm-app +// project (BackendApplication.java). Not a secret — this is the exact +// value the Stockholm JS expects to read via getConstant("kilo") when +// nothing else has stored a different one. Seeded into NativeState on +// first run; also returned by the bridge as a fallback if the state +// entry is missing. +const kiloDefaultValue = "a7928d7b43dcd49f0af31e5aeed26458" + func randomHexUUID() string { b := make([]byte, 16) _, _ = rand.Read(b)