From 10bc44d17d5f456e642e129d5feade66ce01b42e Mon Sep 17 00:00:00 2001 From: Adam Van Ymeren Date: Fri, 4 Jul 2025 15:03:59 -0700 Subject: [PATCH] scoped_store: Fix user access hash fetching --- pkg/connector/store/scoped_store.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/connector/store/scoped_store.go b/pkg/connector/store/scoped_store.go index babac888..e1648d07 100644 --- a/pkg/connector/store/scoped_store.go +++ b/pkg/connector/store/scoped_store.go @@ -207,14 +207,13 @@ func (s *ScopedStore) SetChannelAccessHash(ctx context.Context, forUserID, chann // Deprecated: only for interface, don't use directly. Use [GetAccessHash] // instead. -func (s *ScopedStore) GetUserAccessHash(ctx context.Context, forUserID int64, userID int64) (accessHash int64, found bool, err error) { +func (s *ScopedStore) GetUserAccessHash(ctx context.Context, forUserID int64, userID int64) (int64, bool, error) { s.assertUserIDMatches(forUserID) - accessHash, err = s.GetAccessHash(ctx, ids.PeerTypeUser, userID) + accessHash, err := s.GetAccessHash(ctx, ids.PeerTypeUser, userID) if errors.Is(err, ErrNoAccessHash) { - err = nil - found = false + return 0, false, nil } - return + return accessHash, true, err } // Deprecated: only for interface, don't use directly. Use [SetAccessHash]