Repository navigation
fix(sse): cap concurrent indexer SSE streams per identity - #1813
rajesetavie-maker wants to merge 6 commits into
Conversation
|
@rajesetavie-maker 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! 🚀 |
0b86ef4 to
2bd74a8
Compare
|
this PR is ready for another review. I resolved the merge conflicts with the main branch (pushed 2f0648d). |
Strips the payload this branch picked up (deleted api.js, truncated tailwind.config.js, unhooked package.json). No functional change to the branch's own work.
|
@rajesetavie-maker Our automated scan matched code from the PolinRider malware campaign, which steals developer credentials (GitHub, npm, wallets) and spreads through infected repositories:
What to do:
The PR will be re-scanned automatically and can be merged once it is clean. |
|
This PR came from a machine infected with the PolinRider malware. We stripped the malware files, but the code itself also contains corrupted changes (random character mutations / sabotage), so it cannot be merged. Found: |
|
@rajesetavie-maker Our automated scan matched code from the PolinRider malware campaign, which steals developer credentials (GitHub, npm, wallets) and spreads through infected repositories:
What to do:
The PR will be re-scanned automatically and can be merged once it is clean. |
|
@greatest0fallt1me — this PR is ready for another review. I resolved the merge conflicts with the main branch (pushed 50228ca). |
Overview
This PR caps concurrent
GET /api/indexer/sseconnections per identity and per instance, adds heartbeats, reports queue drops in-band instead of via an undeliverable header, and un-quarantines the route's test suite. It also updates the status route and OpenAPI tests that depend on the SSE contract.Related Issue
Changes
🔒 SSE Concurrency Control
[MODIFY]
app/api/indexer/sse/route.tsMap<identity, number>of open streams.SSE_MAX_CONCURRENT_PER_IDENTITY(default 3) andSSE_MAX_CONCURRENT_GLOBAL(default 500); over-limit requests return429withRetry-After.cancel,request.signalabort, completion, and error.: pingheartbeat comment every 15 seconds to keep proxies from closing idle streams.event: stream_endwithdata: { reason, dropped }before closing, sourced fromSseQueuedrop counts.X-SSE-Queue-Dropped"on stream close" header documentation and updated the route header doc.export const runtime = "nodejs".[MODIFY]
app/api/indexer/status/route.ts🧪 Test Suite Un-quarantine
[MODIFY]
jest.config.jsapp/api/indexer/sse/route.test.tsfromtestPathIgnorePatterns.[MODIFY]
__tests__/openapi-auth-wallet.test.ts[MODIFY]
__tests__/openapi-webhooks.test.tsRoot-Cause Table for Quarantined Failures
X-SSE-Queue-Droppedon stream close, but headers are committed before streaming begins, so the value could never be delivered. Replaced with an in-bandstream_endevent.checkRateLimit(identity, "read")bounded open streams; it only counts connection attempts. Added explicit per-identity and global concurrency counters.stream_endpayload and concurrency429behavior.Verification Results
indexer/sseentry removed fromtestPathIgnorePatternsinjest.config.jsnpx jest app/api/indexerpassesnpm test,npm run lint,npm run buildpass and CI is greenCloses #1678