Repository navigation
fix: repair test and contract files that were committed as base64 - #376
Merged
github-actions[bot] merged 4 commits intoOct 18, 2026
Merged
github-actions[bot] merged 4 commits into
github-actions[bot] merged 4 commits into
Conversation
Line 40 of jest.config.js carried ~26KB of minified/obfuscated JavaScript appended after the legitimate config object. It contained eval() and a detached child_process.spawn of a -e script, plus outbound fetch calls, and executed every time Jest loaded its configuration. Introduced in e4c92ad. This restores the file to the intended 40-line config; no configuration values change.
src/common/guard/quota.guard.spec.ts was committed as a single base64 line (26k chars) in f6c09b5, so the suite failed to parse and the file masked every other TypeScript error (tsc stops after syntax errors). - restore the last plain revision of the spec and extend it with redis-backed monthly quota coverage (counter increments, paid limit, 429 QUOTA_EXCEEDED, enterprise unlimited) using a mocked redis driver - declare the redis package the guard imports; it was used but never a dependency, so any test importing quota.guard failed to resolve it - rename the MONTHLY_QUOTA_LIMITS key pro -> paid to match the RateLimitTier union; paid requests previously fell back to the free 10k limit via the ?? fallback in consumeMonthlyQuota
The script was committed as one base64 line in fee9663 and its decoded content was damaged in several places (mangled function signature, unterminated template literal, a comment-terminated expression, plus a truncated tail). Rebuild it from the decoded body: repair the four corrupted statements, re-derive the generateOpenAPISpec/main tail from the last plain revision (fee9663~1), and keep the breaking-change detection that fee9663 added. The file type-checks under ts-node again.
'any nested **/migration/* directory' contains the byte sequence */ in the middle of a block comment, which closes it early; the word 'followed by migration' then parses as code and tsc fails with TS2304: Cannot find name 'migration'. That error aborted every ts-node boot path (openapi:export, openapi:validate). Escape the slash so the glob stays readable.
|
Hey @OkeyAmy! 👋 It looks like this PR isn't linked to any issue. If this PR is for one of the issues assigned to you as part of a Wave, please link it to ensure your contribution is tracked properly. You can do this by adding a keyword to the PR description (e.g.,
|
Code Review & Auto-Merge — @dorismaduegbunam 🚀Thank you @OkeyAmy for your contribution!
Verified code changes and repository requirements. Merging pull request. |
github-actions
Bot
merged commit Oct 18, 2026
f94cdfe
into
TRELLIS-STELLAR:main
1 of 3 checks passed
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.
Scope
Three files on
mainare broken: two are not source code at all, and they get in the way of every contributor's test run. Each one is repaired here.src/common/guard/quota.guard.spec.tslanded inf6c09b5as one 26,295-character base64 line, which makes Jest abort the suite with a parse error. The last readable revision is restored, then extended — monthly quota behavior had zero coverage before this. The guard's redis counter is driven by a mocked client: one increment per request, a paid tier limit of 1,000,000 (not the 10,000 free-tier fallback), 429QUOTA_EXCEEDEDonce the allowance runs out, andunlimitedfor enterprise while redis stays untouched.scripts/validate-openapi.tsbecame a base64 line infee9663, and decoding it reveals damage that the encoding alone did not cause: the header readsfunction parseArgvv: {, a template literal is missing its closing backtick,curItemappears where the identifier iscurrItem, and the output stops in the middle of aconsole.log. The file is rebuilt from the decoded body with those four statements repaired; thegenerateOpenAPISpecandmainsections are carried back over fromfee9663~1, the last plain version, and the breaking-change checks introduced byfee9663are kept.src/storage-compatibility/storage-schema-compatibility.tsspells out the glob**/migration/*inside a doc comment. The embedded*/terminates the comment early and leavesmigrationas a bare identifier, so ts-node abortsopenapi:exportandopenapi:validatewithTS2304: Cannot find name 'migration'. Escaping the slash keeps the text intact.Alongside these
redispackage is added topackage.json.quota.guard.tsimports it, yet nothing ever declared it, so any spec loading the guard died withCannot find module 'redis'.MONTHLY_QUOTA_LIMITSusespaidwhere it usedpro, consistent withRateLimitTier = "free" | "paid" | "enterprise". Previously the paid tier matched no key and slipped into?? MONTHLY_QUOTA_LIMITS.free, capping paying callers at 10,000 requests per month. A test now locks in the correct number.The consequence of a base64 test file
While any file has a syntax error,
tsc --noEmitemits syntactic diagnostics and never reaches semantic analysis. The blob produced exactly two errors, both in itself, and obscured roughly 295 genuine type errors spread across 80 files. Those remain — fixing them belongs elsewhere — but the blindfold is gone.Checks
npx jest src/common/guard/quota.guard.spec.ts— 7 of 7 greennpx tsc --noEmit— clean for every file touched here; overall counts shift only by the two errors this resolvesnpm run openapi:exportnow advances paststorage-schema-compatibilityand halts on the next missing module,notification-deduplication.service. One blocker cleared; the others are pre-existing.Reverting
The commits are independent, one per set of files. Revert any of them and the tree returns to its previous state. There are no schema or runtime links, with
redisas the only added dependency.Stacked on #375 (jest.config.js payload removal). Until that merges, this diff includes its one commit as well; the reviewable slice for this PR is the three
fix:commits on top.