From 5f37856927dd4bbeefa346ea0bf1909fd8bcd0ef Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Thu, 20 Mar 2025 14:35:06 +0300 Subject: [PATCH] Added activeSym logs --- handlers/application/menuhandler.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/handlers/application/menuhandler.go b/handlers/application/menuhandler.go index dec7cd2..a289076 100644 --- a/handlers/application/menuhandler.go +++ b/handlers/application/menuhandler.go @@ -1941,9 +1941,11 @@ func (h *MenuHandlers) SetDefaultVoucher(ctx context.Context, sym string, input flag_no_active_voucher, _ := h.flagManager.GetFlag("flag_no_active_voucher") // check if the user has an active sym - _, err = userStore.ReadEntry(ctx, sessionId, storedb.DATA_ACTIVE_SYM) + activeSym, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_ACTIVE_SYM) if err != nil { + logg.InfoCtxf(ctx, "Checking the data as no", "DATA_ACTIVE_SYM", storedb.DATA_ACTIVE_SYM) + if db.IsNotFound(err) { publicKey, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_PUBLIC_KEY) if err != nil { @@ -1958,6 +1960,8 @@ func (h *MenuHandlers) SetDefaultVoucher(ctx context.Context, sym string, input return res, nil } + logg.InfoCtxf(ctx, "fetched user vouchers in SetDefaultVoucher", "public_key", string(publicKey), "vouchers", vouchersResp) + // Return if there is no voucher if len(vouchersResp) == 0 { res.FlagSet = append(res.FlagSet, flag_no_active_voucher) @@ -2007,6 +2011,8 @@ func (h *MenuHandlers) SetDefaultVoucher(ctx context.Context, sym string, input return res, err } + logg.InfoCtxf(ctx, "The activeSym:", "activeSym", string(activeSym)) + res.FlagReset = append(res.FlagReset, flag_no_active_voucher) return res, nil