fix: ban unexplained @ts-ignore, full-jitter reconnect, and batched cache stats (#809 #810 #811) - #892
Merged
RUKAYAT-CODER merged 3 commits intoJul 27, 2026
Conversation
|
@monique-7arch 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! 🚀 |
Contributor
|
Thank you for contributing to the project. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #809
Closes #810
Closes #811
Closes #809
Summary
Three fixes addressing TypeScript discipline, socket reconnect reliability under load, and response-interceptor performance.
#809 — Ban unexplained @ts-ignore comments
Added
'@typescript-eslint/ban-ts-comment'toeslint.config.jswith'allow-with-description'for both@ts-ignoreand@ts-expect-error. Both are still permitted when they include a minimum-10-character justification comment, so legitimate suppressions are not blocked — they just have to explain themselves.@ts-nocheckis fully banned (no exceptions). This closes the gap where a silent@ts-ignorecould hide genuine type regressions from CI.#810 — Full jitter for socket reconnect backoff
The previous jitter formula was
delay × (0.9 + random × 0.2), which scatters reconnects only within ±10 % of a fixed delay. When a server restarts and many clients reconnect simultaneously, all delays cluster tightly in the same narrow window — a thundering herd that worsens the outage. Replaced with full jitter:Math.round(Math.random() × ceiling), which draws a uniformly random value across the entire backoff interval. This spreads reconnect attempts evenly over[0, ceiling]and eliminates correlated load spikes.#811 — Batched cache statistics
The response interceptor previously recomputed cache hit-rate on every successful response. For apps issuing dozens of requests per minute this adds measurable JS-thread work on every round-trip. Replaced with a lightweight counter pair (
_cacheStats.hits / misses) that is incremented per response (O(1)) and flushed to the logger on a 60-secondsetInterval. The flush resets counters and logs hit-rate, hit count, and total requests. AflushCacheStatsNowexport lets callers (e.g. app-background handlers) trigger an immediate flush before the interval fires.Files changed
eslint.config.js— ban-ts-comment rule with description requirement ([TypeScript] Multiple @ts-ignore comments in axios.config.ts suppress real type errors #809)src/services/socket/index.ts— full jitter reconnect backoff ([Performance] Socket reconnect backoff in socket/index.ts uses fixed jitter — no server load awareness #810)src/services/api/axios.config.ts— batched 60 s cache stats flush ([Performance] axios.config.ts calculates cache hit rate on every response — should be batched #811)