Skip to content

Commit 1385a4f

Browse files
committed
connector: fix hardcoded_wa_version in log
1 parent 2c38e78 commit 1385a4f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/connector/connector.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ func (wa *WhatsAppConnector) Stop() {
159159

160160
const kvWAVersion = "whatsapp_web_version"
161161

162+
var hardcodedWAVersion = store.GetWAVersion()
163+
162164
func (wa *WhatsAppConnector) onFirstBackgroundConnect() {
163165
verStr := wa.Bridge.DB.KV.Get(wa.Bridge.BackgroundCtx, kvWAVersion)
164166
if verStr == "" {
@@ -171,7 +173,7 @@ func (wa *WhatsAppConnector) onFirstBackgroundConnect() {
171173
return
172174
}
173175
wa.Bridge.Log.Debug().
174-
Stringer("hardcoded_version", store.GetWAVersion()).
176+
Stringer("hardcoded_version", hardcodedWAVersion).
175177
Stringer("cached_version", ver).
176178
Msg("Using cached WhatsApp web version number")
177179
store.SetWAVersion(ver)
@@ -184,7 +186,7 @@ func (wa *WhatsAppConnector) onFirstClientConnect() {
184186
wa.Bridge.Log.Err(err).Msg("Failed to get latest WhatsApp web version number")
185187
} else {
186188
wa.Bridge.Log.Debug().
187-
Stringer("hardcoded_version", store.GetWAVersion()).
189+
Stringer("hardcoded_version", hardcodedWAVersion).
188190
Stringer("latest_version", *ver).
189191
Msg("Got latest WhatsApp web version number")
190192
store.SetWAVersion(*ver)

0 commit comments

Comments
 (0)