Skip to content

Feat Testing | Add unit tests for src/middleware/sanitize.js edge cases closes #564 - #640

Merged
Sulex45 merged 4 commits into
stellarkit-lab-devtools:mainfrom
Idahjnr007:feat-Testing-Closes-#564
Jul 29, 2026
Merged

Feat Testing | Add unit tests for src/middleware/sanitize.js edge cases closes #564#640
Sulex45 merged 4 commits into
stellarkit-lab-devtools:mainfrom
Idahjnr007:feat-Testing-Closes-#564

Conversation

@Idahjnr007

@Idahjnr007 Idahjnr007 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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

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.
@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@Sulex45
Sulex45 merged commit b87b325 into stellarkit-lab-devtools:main Jul 29, 2026
0 of 3 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.

Testing | Add unit tests for src/middleware/sanitize.js edge cases

2 participants