Repository navigation
fix(app): /verify and /r/... 500 in production from publicConfig() - #26
Merged
Merged
Conversation
Both pages called publicConfig() unconditionally just to label the asset for display. That validates the whole shared config, including NEXT_PUBLIC_INDEXER_URL, which isn't set in this deployment (no indexer yet, M2-18). Neither page needs the indexer at all. Wrapped the call in try/catch, degrading to no asset label on failure, same as the existing fallback for a missing lock.
This was referenced Oct 8, 2026
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.
What and why
Production bug (reported by the owner):
/verifyand/r/[txHash]/[eventIndex]return500on the live site, even though the build and local test suite were green. Root cause:publicConfig()validates the entire sharedPublicConfigschema, includingNEXT_PUBLIC_INDEXER_URL, which genuinely isn't set in this Vercel project (no indexer deployed yet,M2-18)./send,/request, and/payeehappen to never hit that call, because they only reachpublicConfig()after a successful indexer fetch (guarded by atry/catcharoundlistPayees()); my new receipt pages call it unconditionally just to label the asset for display, with no such guard, so it throws on every request.Changes
app/r/[txHash]/[eventIndex]/useReceiptPage.ts,app/verify/useVerifyForm.ts: wrap thepublicConfig()call intry/catch, degradingusdctonullon failure.components/receipts/ReceiptResult.tsx:usdcprop is now{ contractId, issuer } | null; the amount display falls back to no asset label whenusdc(orlock) is unavailable, reusing the fallback that already existed for a missinglock.Hard rules / invariants touched
None. Display-only fallback; doesn't touch
verifyReceipt's actual verification result or the "Payment to verified payee" gating.Tests
pnpm lint,pnpm typecheck,pnpm test(93/93),pnpm buildall green. Reproduced the exact failure locally first: ran the dev server with the real.env.local(which has noNEXT_PUBLIC_INDEXER_URL, matching production) and hit/verifyand/r/<hash>/0directly, both500before the fix; both200after it, before redeploying to production.Docs / ADR
None needed.
Roadmap
No row status change (
M3-13staysDONE; this is a bugfix, not new scope). Changelog entry added.Assumptions and open questions
The underlying tension remains:
publicConfig()'s "fail loudly on any missing field" design (its own code comment) means any future code that touches it without an indexer-fetch guard will hit the same class of bug untilNEXT_PUBLIC_INDEXER_URLis actually set (M2-18) orNEXT_PUBLIC_INDEXER_URLis made optional inlib/config.ts's schema. Didn't change that schema here since it's a shared contract touching every page; flagging it rather than changing it unilaterally.Given production was actively broken, I deployed this fix to
kinlock-app.vercel.appviavercel --prodas soon as it was locally verified, ahead of this PR being merged.mainshould be fast-forwarded to match once this merges.