Feat Testing | Add unit tests for src/middleware/sanitize.js edge cases closes #564 - #640
Merged
Sulex45 merged 4 commits intoJul 29, 2026
Conversation
Performance & Caching | Add cache TTL to GET /account/:id/asset-balance responses Repo Avatar Single asset balance lookups are frequently called by apps checking balances before transactions. Add a cache with a default TTL of 10 seconds configurable via CACHE_TTL_ASSET_BALANCE_MS keyed by account ID, asset code, and issuer. Return X-Cache headers and support ?fresh=true bypass. Acceptance Criteria: Asset balance responses are cached per account, code, and issuer. X-Cache header is present. ?fresh=true bypasses the cache. TTL is configurable. .env.example is updated. closes stellarkit-lab-devtools#558
New Endpoints | Add GET /network/fee-percentiles endpoint
Repo Avatar
Developers submitting transactions need detailed fee percentile data to choose the right fee for their urgency level. Add a GET /network/fee-percentiles endpoint that returns fee stats at multiple percentile levels — p10, p20, p30, p50, p70, p90, p95, p99 — in both stroops and XLM, along with the current ledger's accepted fee range.
Acceptance Criteria: Returns { success: true, data: { percentiles: { p10, p20, p30, p50, p70, p90, p95, p99 }, minFee, maxFee, ledgerSequence } }. All fee values in both stroops and XLM. Response is cached with a 5 second TTL.
Testing | Add unit tests for src/middleware/sanitize.js edge cases Repo Avatar stellarkit-lab-devtools/stellarkit-api The sanitize middleware handles input cleaning for all requests but edge cases around nested objects, arrays, and very large payloads are not covered. Add tests for: deeply nested object sanitization, array of strings in request body, a body with 100 keys, and a request with no body. All tests should be in tests/middleware/sanitize.test.js. Acceptance Criteria: All new tests pass with npm test. Coverage for sanitize.js reaches 100%. No functional changes to the middleware.
|
@Idahjnr007 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! 🚀 |
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 #564
Testing | Add unit tests for src/middleware/sanitize.js edge cases
Repo Avatar
stellarkit-lab-devtools/stellarkit-api
The sanitize middleware handles input cleaning for all requests but edge cases around nested objects, arrays, and very large payloads are not covered. Add tests for: deeply nested object sanitization, array of strings in request body, a body with 100 keys, and a request with no body. All tests should be in tests/middleware/sanitize.test.js.
Acceptance Criteria: All new tests pass with npm test. Coverage for sanitize.js reaches 100%. No functional changes to the middleware.
Closes 546