Skip to content

fix: launch hotfixes — Neon adapter + Location backfill + global ReportIssue + viewport#6

Open
abdout wants to merge 3 commits into
mainfrom
fix/launch-blockers-A
Open

fix: launch hotfixes — Neon adapter + Location backfill + global ReportIssue + viewport#6
abdout wants to merge 3 commits into
mainfrom
fix/launch-blockers-A

Conversation

@abdout
Copy link
Copy Markdown
Contributor

@abdout abdout commented Apr 26, 2026

Summary

Phase A of the production-readiness push (plan: kun/.claude/plans/resume-the-development-in-abstract-rossum.md). Three atomic commits:

  • fix(db): auto-select the neon serverless adapter when DATABASE_URL points at *.neon.tech. Previously the pg adapter held a long-lived TCP connection that Neon dropped on serverless suspend; the next query then 500'd with Server has closed the connection. Pairs with a manual backfill (via Neon MCP) of the missing Location.createdAt / Location.updatedAt columns — schema.prisma listed them but the add_timestamps_lease_payment_location_tenant migration had only ever applied the Lease/Payment/Tenant ALTERs to prod, so every Listing.findMany failed once the nested location include resolved.
  • refactor(report-issue): drop the pathname.startsWith("/ar") heuristic for the existing dictionary.reportIssue.* slice via useDictionary(). Restructure the server-action input shape so viewport/direction/browser live under a meta object (canonical body order matches the kun report-agent parser). Self-bootstrap the report GitHub label on 422.
  • feat(layout): mount <ReportIssue variant="icon"/> as a fixed-position floating button in [lang]/layout.tsx so all 117 locale-prefixed routes expose the widget (previously only two footer mounts). Add Next 16 viewport export (width / initialScale / themeColor honouring prefers-color-scheme). Move the bilingual skip-link literal to common.skipToContent in both dictionaries.

Verification

Local:

  • pnpm typecheck clean.
  • pnpm build clean (50 routes, /api/listings/published rebuilt as static with 5m revalidate).
  • curl http://localhost:3000/api/listings/published | jq length50.
  • /, /ar, /en/login, /en/listings all render the Bug icon (1 marker each); Arabic page emits aria-label="الإبلاغ عن مشكلة" and the dictionary-driven Arabic skip-link.

Production (post-merge /watch):

  • curl https://mk.databayt.org/api/listings/published | jq length returns >0.
  • Visit /, /login, /hosting, /admin, /transport-host/x/office-info and confirm the Bug icon appears bottom-end.
  • Submit a test report from any of the above; new issue lands at databayt/mkan/issues labelled report with the canonical body schema (Page / Time / Reporter / Browser / Viewport / Direction).
  • Vercel runtime logs show no Server has closed the connection over 24h.

Production env (issue #3)

Ensuring GITHUB_PERSONAL_ACCESS_TOKEN (scope repo), DATABASE_URL, AUTH_SECRET, and Stripe live keys are set in the Vercel project env is out of scope for this PR (no code change). I'll close #3 manually after confirming via vercel env ls.

Out of scope

  • Default-locale flip (enar) — lands in Phase B alongside the i18n sweep so dictionary parity is verified first.
  • Phase B / C / D — separate PRs per the plan (one phase, one PR).

Closes #4
Closes #5
Refs #3

abdout added 3 commits April 26, 2026 14:25
…d-start

The pg adapter holds long-lived TCP connections that Neon drops when its
serverless compute scales to zero, causing the next query to fail with
"Server has closed the connection". The neon serverless adapter speaks
HTTPS+WS and wakes the compute on demand. Detect Neon URLs and switch
automatically when DATABASE_URL_ADAPTER is unset.

Pairs with a backfill of the missing Location.createdAt/updatedAt columns
applied via Neon MCP — schema.prisma listed them but production never
received the ALTER TABLE, so every Listing.findMany() failed once the
nested location include resolved.

Refs #4
…apes, restructure meta

- Replace pathname.startsWith("/ar") heuristic with the existing
  reportIssue.* dictionary slice via useDictionary(). A single locale
  source keeps the widget consistent with every other localized surface.
- Use literal Arabic glyphs in fallback handling instead of \u escape
  sequences (carry-over from the previous edit; Arabic is now sourced
  from the dictionary anyway).
- Pull browser/viewport/direction into a nested `meta` object on the
  server action's input shape so the body fields are always emitted in
  the same canonical order — needed by the kun report-agent parser.
- Self-bootstrap the `report` GitHub label on 422 with color #d93f0b so
  the action works in any repo without manual seeding.

Refs #5
…link

Mounts <ReportIssue variant="icon"/> as a fixed-position floating button
in the locale-root layout so every one of the 117 locale-prefixed routes
exposes the report widget. Previously only two footer components carried
it, leaving auth, hosting, dashboard, transport, and admin surfaces with
no path to file a bug.

Adds the explicit Next 16 viewport export (width/initialScale/themeColor)
that mobile Safari needs to render at the correct DPR and to honour
prefers-color-scheme for the address bar.

Moves the bilingual skip-link literal at layout.tsx:74 to
common.skipToContent in both dictionaries — the only remaining inline
ternary in the locale-root layout.

Refs #5
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mkan Ready Ready Preview, Comment Apr 26, 2026 11:28am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant