Difficulty: Hard
Type: Bug
Summary
Fix cache invalidation so guild-scoped and wallet-scoped entries are actually removed when invalidation helpers are called.
Current Behaviour
invalidateGuildCache builds prefix-like cache keys such as access:checkAccess:${guildId}:, then calls cache.delete(key). The cache adapter only deletes exact keys, so entries like access:checkAccess:prime-guild:premium-docs:0x... are not removed.
Expected Behaviour
Invalidation helpers should remove all matching cache entries for the target guild or wallet without requiring a full cache clear unless the adapter cannot support targeted deletion.
Suggested Implementation
Extend the cache adapter contract with an optional deleteByPrefix(prefix: string) method. Implement prefix deletion in InMemoryCacheAdapter. Update invalidateGuildCache to use prefix deletion when available and document fallback behaviour for custom adapters.
Files or Areas Likely Affected
src/client/GuildPassClient.ts
src/cache/cache.types.ts
tests/
docs/sdk-guide.md
Acceptance Criteria
Additional Notes
This issue is separate from adding pluggable caching. It focuses on correctness of the cache invalidation helpers that already exist.
Difficulty: Hard
Type: Bug
Summary
Fix cache invalidation so guild-scoped and wallet-scoped entries are actually removed when invalidation helpers are called.
Current Behaviour
invalidateGuildCachebuilds prefix-like cache keys such asaccess:checkAccess:${guildId}:, then callscache.delete(key). The cache adapter only deletes exact keys, so entries likeaccess:checkAccess:prime-guild:premium-docs:0x...are not removed.Expected Behaviour
Invalidation helpers should remove all matching cache entries for the target guild or wallet without requiring a full cache clear unless the adapter cannot support targeted deletion.
Suggested Implementation
Extend the cache adapter contract with an optional
deleteByPrefix(prefix: string)method. Implement prefix deletion inInMemoryCacheAdapter. UpdateinvalidateGuildCacheto use prefix deletion when available and document fallback behaviour for custom adapters.Files or Areas Likely Affected
src/client/GuildPassClient.tssrc/cache/cache.types.tstests/docs/sdk-guide.mdAcceptance Criteria
invalidateGuildCacheremoves all access, membership, role, and guild entries for the target guildInMemoryCacheAdaptersupports prefix deletionclearCachebehaviour remains unchangedAdditional Notes
This issue is separate from adding pluggable caching. It focuses on correctness of the cache invalidation helpers that already exist.