Repository navigation
fix: repair dev after the 2026-10-18 to 2026-10-22 merges - #1090
Merged
Merged
Conversation
dev stopped compiling on 2026-10-18 (#1016 and #1011 left half-merged code behind), so every PR merged since was never type checked or tested in CI. This fixes the build and the failures it was hiding. Build: - admin-stats.service: drop the stale pre-repository block #1016 pasted in - update-vendor-profile.dto: keep only the PartialType class from #1011 - sep10.constants, config.module: restore what #1077 overwrote from an old base; move its ACCESS_TOKEN_TTL max(86400) into config.schema - escrow.service: remove the duplicate encryptContact import; notifyCancelled never existed, so refunds use notifyRefunded and cancels notify nothing, like the other cancel paths - main.ts, stress-test controller, account details DTO: missing imports - notifications.service: remove dispatch, unused since #1019, and move its spans onto the buyer dispatch path Runtime: - logistics.module: GiglClient's factory injected GiglLogisticsService, which injects GiglClient, so the app could not boot. Resolve the service through ModuleRef when the token is read - tracking-poll.worker: restore the no-trackingId and unmapped-escrow guards and drop the non-null assertion on contractEscrowId Tests updated for intended behaviour changes: JwtGuard reads config only (#1032), GiglClient takes getApiToken (#1016), no sends to Stellar addresses (#946), quiet polls advance the cursor (#917, #1042), audit log filters (#1015), unmapped escrows excluded (#960), /admin/credentials (#1033), E.164 phones (#1010), ISO 4217 currency (#1064). Restores two tests #1077 deleted. Prettier fixes across files the merges left unformatted.
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.
Summary
devstopped compiling on 2026-10-18 when #1016 and #1011 left half-merged code in two files. CI failed at the typecheck from then on, so none of the PRs merged since were type checked or tested. This PR fixes the build and every failure the broken build was hiding.Verified locally on Node 22 against Postgres, using the env from each workflow:
npm run typechecknpm run lint:checknpm run buildnpm run test:covcheck_coverage.jscheck_test_match.jsnpm run openapi:generatenpm run test:integrationnpm run test:e2eBuild fixes
admin-stats.service.ts: Fix/stress test bounds 404 logistics key rotation admin stats count #1016 pasted the pre-repository version ofgetStatsinto the current one. Restored the version from before Fix/stress test bounds 404 logistics key rotation admin stats count #1016. The distinct counts already live inAdminStatsRepository.update-vendor-profile.dto.ts: fix: resolve issues 939, 942, 943, and 946 #1011 switched toPartialType(CreateVendorProfileDto)(UpdateVendorProfileDtoduplicates the create DTO by hand #939) but left the old class body below it. That body is removed.sep10.constants.tsandconfig.module.ts: ACCESS_TOKEN_TTL has no upper bound and no test #1077 was built on an old base. It deleted three SEP-10 constants and replaced the shared config schema with a stale inline copy that has noJoiimport and noignoreEnvFile. Both files are restored. Its real change (ACCESS_TOKEN_TTLmax 86400) is now inconfig.schema.ts. Its TTL tests now check the real schema, and the two tests it deleted are back.escrow.service.ts:encryptContactimport.notifyCancelled, which never existed. The two refund cases now usenotifyRefunded. The two cancel cases notify nobody, matching the existing cancel paths (there's no cancelled template).INestApplicationandparseTrustProxyinmain.ts,IsISO4217CurrencyCodein the account details DTO, andimport typeforStressTestResult.notifications.service.ts:dispatchhas had no callers since fix: close remaining Stellar vendor dispatch path (#942, #943, #946) #1019, so it's removed. Its tracing spans move onto the buyer dispatch path so notification tracing isn't lost.Runtime fixes
logistics.module.ts: the app could not boot. TheGiglClientfactory (fix: resolve issues 1054, 1055, 1056, 1057 #1075) injectedGiglLogisticsService, which injectsGiglClient, so Nest hit a circular dependency. The factory now resolves the service throughModuleRefwhen it reads the token, so key rotation (Rotating the logistics key still does not change the key the carrier client sends #1054) still takes effect immediately.tracking-poll.worker.ts: restored the no-trackingIdand unmapped-escrow guards and thetracking_poll.unmapped_escrowlog, and removed thecontractEscrowId!assertion. The repository query still does the filtering (The tracking poll does work it then throws away #960). The guards are a safety net.Tests updated for intended behavior
Each of these changes was deliberate in its PR, but the PR never updated the tests:
JwtGuardreads the secret only fromConfigService(fix(config): config/env hardening — closes #976 #977 #979 #980 #1032). Three controller specs now provide one, and the Prisma module mock gainsget.GiglClienttakesgetApiTokenand sends the token on each request (Fix/stress test bounds 404 logistics key rotation admin stats count #1016).getLatestLedgercall (The poller cursor never moves while the contract is quiet #917, A paging token cursor still goes stale while the contract is quiet #1042). Lifecycle tests countgetEventsrequests.where(feat(audit): add filters, audit trail, and atomic DLQ replay #1015).findShippedWithTrackingexcludes unmapped escrows (The tracking poll does work it then throws away #960). Fixtures are mapped, and a new test covers the exclusion./admin/credentialsmaps toadmin.api_keys(fix: resolve issues 971, 972, 974, and 975 #1033).preferredCurrencyis ISO 4217 (Account details accept any currency and unbounded payment methods #1064).The other changed files are prettier reformatting of code the merges left unformatted. In those files, the only change besides whitespace is one redundant type cast removed by ESLint.
Not in this PR
follow-redirectsadvisory (GHSA-8r9p-f939-6h3c). That needs a dependency upgrade.@IsISO4217CurrencyCoderejectsUSDCas a vendor's preferred currency. That follows Account details accept any currency and unbounded payment methods #1064 as written, but it may not be what we want for a USDC platform.