Feature: Routes-F Resiliency & QA Enhancements#356
Merged
davedumto merged 3 commits intoStreamFi-x:devfrom Feb 26, 2026
Merged
Conversation
|
@codebestia is attempting to deploy a commit to the david's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
📝 Description
This PR introduces three major improvements to the
routes-fAPI ecosystem, focusing on request resiliency, safety guards against malformed/abusive payloads, and dedicated QA tooling for predictable testing.1. Idempotency Key Handler ([POST])
Implemented a robust idempotency wrapper to ensure that duplicate [POST] requests do not cause unintended side effects (e.g., duplicated entity creation).
Idempotency-Keyheader. Responses are cached in-memory with a short TTL (60 seconds) configured for safe retries in volatile network conditions.X-Idempotency-Hit: true/falseheader to the response.POST /api/routes-f/itemsandPOST /api/routes-f/import.2. Payload Size Guard Middleware
Introduced a centralized guard wrapper to prevent oversized payloads from reaching application logic, protecting against memory exhaustion and basic DoS vectors.
content-lengthheader against a default 50KB limit (configurable globally viaROUTES_F_MAX_PAYLOAD_BYTESenv var).POST /api/routes-f/importis explicitly configured to allow 100KB payloads).413 Payload Too Largeerror before any body parsing occurs.3. Deterministic Mock Generator (QA Tooling)
Added a dedicated QA endpoint to generate structured, predictable mock data sets for testing UI visualizations without relying on unstable or entirely random seed data.
POST /api/routes-f/mock/generateseed,count, andprofileTypeis guaranteed to return the exact same array of generated records.profileTypeparameter dynamically influences the generated URLs, prefixes, tags, and HTTP verbs (e.g., customizing forfinancial,social, ordefaultpayloads).🧪 Verification & Testing
tsc --noEmitchecks assert strict type safety across all middleware wrappers.✍️ Related Issue
Closes #307
Closes #333
Closes #341