Skip to content

feat: implement concurrent GET request deduplication in apiClient using a cache-based coalescing strategy. - #1286

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
Niffy03:issue-1160-coalesce-duplicate-get-requests
Aug 29, 2026
Merged

feat: implement concurrent GET request deduplication in apiClient using a cache-based coalescing strategy.#1286
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
Niffy03:issue-1160-coalesce-duplicate-get-requests

Conversation

@Niffy03

@Niffy03 Niffy03 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Description

Coalesces duplicate in-flight GET requests onto a single in-flight promise and fans out the resolved results or errors to all concurrent callers.

Key changes:

  • Integrated in-flight request deduplication into apiClient.get() in src/lib/api.ts using dedupe() from src/lib/api/dedupe.ts.
  • Added a dedupe?: boolean option to RequestConfig to allow opting out when necessary ({ dedupe: false }).
  • Updated cache eviction in dedupe() to ensure completed requests are evicted immediately prior to resolution, allowing immediate subsequent requests to make fresh network calls.
  • Added comprehensive unit and integration tests in src/lib/api/__tests__/dedupe.test.ts and src/lib/api/__tests__/api.dedupe.test.ts.

Related Issue

Closes #1160

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • No console errors
  • Uses Lucide icons consistently
  • Responsive design implemented
  • Starknet best practices followed

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Niffy03 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project.

@RUKAYAT-CODER
RUKAYAT-CODER merged commit 769c79f into rinafcode:main Aug 29, 2026
6 checks passed
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.

Coalesce duplicate in-flight GET requests

2 participants