All updates
ProductionQAFrontend

Docker build configuration fix: default redirect URL wiring and client-side hook directive

PR #749heytulsiprasadJan 18, 2026 · 16:35 UTC
QAJan 1, 2026
ProductionJan 18, 2026

Executive summary

A small build-configuration fix reached QA that wires a new NEXT_PUBLIC_DEFAULT_REDIRECT_URL setting through the Docker image build for production and QA, and marks the shared mobile-detection hook as client-side. This stabilizes containerized builds and ensures the post-login default redirect target is available to the deployed apps.

Why this was needed

Containerized (Docker) production and QA builds were missing a configuration value (NEXT_PUBLIC_DEFAULT_REDIRECT_URL) that the apps expect, and a shared UI hook that relies on browser-only React features (useState/useEffect) was not explicitly marked as client-side. The latter can surface as React runtime errors during server-side rendering in production builds.

Client / user impact

  • Deployed QA and production images now carry a defined default redirect destination (the mail app URL), giving the apps a reliable fallback for post-login navigation.
  • The shared mobile-detection hook is now correctly treated as client-only, reducing the chance of rendering errors in the containerized builds.
  • No end-user-visible feature change; this is reliability/configuration hardening for the deployment pipeline.

Technical scope

Grounded in the actual merged diff (3 files, +7/-0):

  • .github/workflows/docker-ecr.yml: adds NEXT_PUBLIC_DEFAULT_REDIRECT_URL=https://cortex-mail.datagainservices.com to both the production and QA env setup, and passes it as a --build-arg to the Docker build.
  • Dockerfile: declares the matching ARG NEXT_PUBLIC_DEFAULT_REDIRECT_URL and exports it as an ENV so it is baked into the build.
  • packages/ui/src/hooks/use-mobile.ts: adds the "use client" directive at the top of the hook that uses useState/useEffect.

Note: the PR title/body also mentioned a broad React named-import refactor across many files and a Python/canvas Dockerfile change, but those did not land in this merge — the merged changeset is limited to the three items above.

Risk & mitigation

Low risk. Changes are additive build-pipeline configuration plus a one-line directive; nothing is removed (0 deletions). Main risk is the hardcoded redirect URL pointing both QA and production at the production mail domain (cortex-mail.datagainservices.com) — worth confirming this is the intended default for the QA image. Mitigation: validate the deployed env value per environment after build.

QA validation focus

  • Confirm the QA Docker image builds successfully with the new build-arg present.
  • Verify NEXT_PUBLIC_DEFAULT_REDIRECT_URL resolves to the expected value in the running QA container (and confirm whether QA should point to the production mail URL).
  • Smoke-test post-login navigation / default redirect behavior in the QA mail app.
  • Exercise responsive/mobile-breakpoint UI to confirm the mobile-detection hook works and no React hydration/runtime errors appear in the console.