Skip to content

In flight request deduplication#105

Open
gloskull wants to merge 2 commits into
Adamantine-guild:mainfrom
gloskull:in-flight-request-deduplication
Open

In flight request deduplication#105
gloskull wants to merge 2 commits into
Adamantine-guild:mainfrom
gloskull:in-flight-request-deduplication

Conversation

@gloskull

Copy link
Copy Markdown

Implemented in-flight request deduplication in the GuildPass SDK to prevent redundant network calls when multiple identical read operations are performed concurrently. This affects access checks, membership lookups, role retrievals, and guild lookups.

Key changes:

Introduced a private inFlightRequests map in GuildPassClient to track active promises by their cache key.
Refactored withCache to check for and return existing in-flight promises.
Guaranteed removal of in-flight entries upon settlement (success or failure) to prevent poisoning.
Added comprehensive tests in tests/deduplication.test.ts.
Documented the new behavior in docs/sdk-guide.md.
Fixed a pre-existing lint error in src/client/GuildPassClient.ts.
Closes #90

google-labs-jules Bot and others added 2 commits June 27, 2026 10:33
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.

- Added `inFlightRequests` Map to `GuildPassClient` to collapse identical requests.
- Updated `withCache` to handle deduplication and promise cleanup.
- Added unit tests to verify deduplication and error handling.
- Updated documentation in `docs/sdk-guide.md`.

Co-authored-by: gloskull <189399494+gloskull@users.noreply.github.com>
…70986552195156

Add in-flight request deduplication for identical reads
@gloskull

Copy link
Copy Markdown
Author

Done with this issue.
Please merge and give and high review.
Please if there are any more tasks, assign them to me, i'd make sure to get them done quickly and submit my PR's in under 5 hours

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add in-flight request deduplication for identical reads

1 participant