Difficulty: Advanced
Type: Feature
Summary
Deduplicate concurrent identical read requests so the SDK does not issue multiple network calls for the same access, membership, role, or guild lookup at the same time.
Current Behaviour
Caching only helps after the first request has completed. If multiple callers request the same key concurrently, each call can still hit the network.
Expected Behaviour
When cache is enabled, concurrent identical reads should share the same in-flight promise and resolve to the same result.
Suggested Implementation
Add an internal in-flight request map keyed by the same cache key used for read caching. Remove entries after resolution or rejection. Ensure rejected requests do not poison future calls.
Files or Areas Likely Affected
src/client/GuildPassClient.ts
src/cache/cache.types.ts
tests/client.test.ts
tests/services.test.ts
docs/sdk-guide.md
Acceptance Criteria
Additional Notes
This should be enabled only for safe read operations.
Difficulty: Advanced
Type: Feature
Summary
Deduplicate concurrent identical read requests so the SDK does not issue multiple network calls for the same access, membership, role, or guild lookup at the same time.
Current Behaviour
Caching only helps after the first request has completed. If multiple callers request the same key concurrently, each call can still hit the network.
Expected Behaviour
When cache is enabled, concurrent identical reads should share the same in-flight promise and resolve to the same result.
Suggested Implementation
Add an internal in-flight request map keyed by the same cache key used for read caching. Remove entries after resolution or rejection. Ensure rejected requests do not poison future calls.
Files or Areas Likely Affected
src/client/GuildPassClient.tssrc/cache/cache.types.tstests/client.test.tstests/services.test.tsdocs/sdk-guide.mdAcceptance Criteria
Additional Notes
This should be enabled only for safe read operations.