From bab4a17bf25b9d8e763f0a78f9ffb362da4faf55 Mon Sep 17 00:00:00 2001 From: Carlosokumu <carlosokumu254@gmail.com> Date: Fri, 6 Dec 2024 12:39:46 +0300 Subject: [PATCH 1/3] remove setsession on userstore --- common/user_store.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/user_store.go b/common/user_store.go index 29796e2..c730b47 100644 --- a/common/user_store.go +++ b/common/user_store.go @@ -19,7 +19,6 @@ type UserDataStore struct { // ReadEntry retrieves an entry to the userdata store. func (store *UserDataStore) ReadEntry(ctx context.Context, sessionId string, typ DataTyp) ([]byte, error) { store.SetPrefix(db.DATATYPE_USERDATA) - store.SetSession(sessionId) k := PackKey(typ, []byte(sessionId)) return store.Get(ctx, k) } @@ -28,7 +27,6 @@ func (store *UserDataStore) ReadEntry(ctx context.Context, sessionId string, typ // BUG: this uses sessionId twice func (store *UserDataStore) WriteEntry(ctx context.Context, sessionId string, typ DataTyp, value []byte) error { store.SetPrefix(db.DATATYPE_USERDATA) - store.SetSession(sessionId) k := PackKey(typ, []byte(sessionId)) return store.Put(ctx, k, value) } -- 2.45.2 From b072c1314b521741f020a7122b1dfbf993012082 Mon Sep 17 00:00:00 2001 From: Carlosokumu <carlosokumu254@gmail.com> Date: Fri, 6 Dec 2024 15:57:22 +0300 Subject: [PATCH 2/3] set session on read entry --- common/user_store.go | 1 + 1 file changed, 1 insertion(+) diff --git a/common/user_store.go b/common/user_store.go index c730b47..2dfc902 100644 --- a/common/user_store.go +++ b/common/user_store.go @@ -18,6 +18,7 @@ type UserDataStore struct { // ReadEntry retrieves an entry to the userdata store. func (store *UserDataStore) ReadEntry(ctx context.Context, sessionId string, typ DataTyp) ([]byte, error) { + store.SetSession(sessionId) store.SetPrefix(db.DATATYPE_USERDATA) k := PackKey(typ, []byte(sessionId)) return store.Get(ctx, k) -- 2.45.2 From 944e1841bb218151ac794f6686d0cb15d3d274a3 Mon Sep 17 00:00:00 2001 From: Carlosokumu <carlosokumu254@gmail.com> Date: Fri, 6 Dec 2024 16:18:27 +0300 Subject: [PATCH 3/3] remove set session on read entry --- common/user_store.go | 1 - 1 file changed, 1 deletion(-) diff --git a/common/user_store.go b/common/user_store.go index 2dfc902..c730b47 100644 --- a/common/user_store.go +++ b/common/user_store.go @@ -18,7 +18,6 @@ type UserDataStore struct { // ReadEntry retrieves an entry to the userdata store. func (store *UserDataStore) ReadEntry(ctx context.Context, sessionId string, typ DataTyp) ([]byte, error) { - store.SetSession(sessionId) store.SetPrefix(db.DATATYPE_USERDATA) k := PackKey(typ, []byte(sessionId)) return store.Get(ctx, k) -- 2.45.2