feat(functions): derive default functions domain as function2.insforge.app - #121
Conversation
…e.app
Deno Deploy Classic (v1) is fully sunset, so the legacy
{appKey}.functions.insforge.app domain no longer works. Point the
SDK's derived default at the v2 CloudFront proxy domain
{appKey}.function2.insforge.app, matching the backend's
FUNCTIONS_DOMAIN default.
Test URLs are updated too: the in-process dispatch short-circuit
requires the configured functionsUrl to equal the derived local URL,
so the explicit URLs in tests must use the new domain.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
WalkthroughChangesFunctions hostname update
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
jwfing
left a comment
There was a problem hiding this comment.
Review: feat(functions): derive default functions domain as function2.insforge.app
Summary: A focused, correct one-line-behavior change that repoints the SDK's derived default functions domain from the sunset {appKey}.functions.insforge.app to the v2 CloudFront proxy {appKey}.function2.insforge.app, with matching doc/example and test updates.
Requirements context
No spec/plan under docs/superpowers/ covers this domain migration specifically. The closest document, docs/superpowers/specs/2026-04-15-functions-in-process-dispatch-design.md (+ its plan), was consulted for the surrounding dispatch logic — this PR is a follow-up operational fix (Deno Deploy Classic v1 sunset), assessed against the PR description and the existing code. The PR body's core claim (new domain matches backend FUNCTIONS_DOMAIN default in backend/src/infra/config/app.config.ts) is a cross-repo fact I can't verify from this workspace; see Information below.
Findings
Critical
(none)
Suggestion
(none)
Software engineering / functionality — Information
src/modules/functions.ts:53— The change is internally consistent with the in-process dispatch short-circuit: the equality guard atfunctions.ts:105-109comparesthis.functionsUrl === localFunctionsUrl, and both sides flow through the samederiveSubhostingUrl(), so the derived default and the short-circuit stay in lockstep. Verified:npx vitest run src/modules/__tests__/functions.test.ts→ 11/11 pass. Scope is tight (derived default only); explicitly-configuredfunctionsUrl, self-hosted (non-.insforge.app) bases, and the 404→proxy fallback are all correctly untouched.docs/superpowers/specs/2026-04-15-functions-in-process-dispatch-design.md:5,7,25,47and the companion plan still reference the old{appKey}.functions.insforge.appdomain. These are historical design records, so updating them is optional — noting only so the docs aren't mistaken for current guidance.- Behavioral caveat (pre-existing, not introduced here): the direct-subhosting path only falls back to the proxy on a
404(functions.ts:146). A user who explicitly setfunctionsUrlto the old, now-dead…functions.insforge.app(per the previous@example) could get a DNS/connection error or 5xx instead of a 404 and would not fall back. This PR fixes the derived default (the common path) and doesn't regress anything; flagging only as a migration awareness note for anyone who hardcoded the old value.
Security
No security-relevant changes — no new inputs reaching SQL/shell/HTTP sinks, no auth changes, no secrets/PII, no new dependencies. deriveSubhostingUrl still gates on hostname.endsWith('.insforge.app') before deriving.
Performance
No performance impact — pure string-derivation change on an existing code path; no new I/O, loops, or allocations.
Verdict
approved (informational — the human still gives the explicit GitHub approval). Zero Critical findings; the change is minimal, correct, well-tested, and in-scope.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Summary
Deno Deploy Classic (v1) is fully sunset, so the legacy
{appKey}.functions.insforge.appdomain no longer works. This PR points the SDK's derived default functions URL at the v2 CloudFront proxy domain{appKey}.function2.insforge.app, matching the backend'sFUNCTIONS_DOMAINdefault (backend/src/infra/config/app.config.ts).Changes
src/modules/functions.ts—deriveSubhostingUrl()now deriveshttps://{appKey}.function2.insforge.app; doc comment updated.src/types.ts—functionsUrl@examplecomment updated.src/modules/__tests__/functions.test.ts— test URLs updated. Note: the in-process dispatch short-circuit requires the configuredfunctionsUrlto strictly equal the derived local URL, so the explicit URLs in tests must use the new domain.Behavior notes
functionsUrlis unaffected..insforge.appbase URLs (self-hosted) still derive nothing and go through the{baseUrl}/functions/{slug}proxy path.Testing
npx vitest run src/modules/__tests__/functions.test.ts— 11/11 pass.ssr.test.ts/auth.test.tsreproduce on cleanmain(verified viagit stash), unrelated to this change. Same for the 5 pre-existingnpm run typecheckerrors caused by a local@insforge/shared-schemasversion mismatch.🤖 Generated with Claude Code
Summary by cubic
Switch the SDK’s default functions domain to https://{appKey}.function2.insforge.app to align with Deno Deploy v2 and the backend default. Fallback to the proxy path remains; explicit
functionsUrland non-.insforge.app bases are unchanged.Migration
Dependencies
@insforge/sdkto 1.5.2.Written for commit a1f4314. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
function2.insforge.apphostname.Documentation
Chores