Debug: Revert #926 revert 1.7.0#949
Open
rchlfryn wants to merge 56 commits intorevert-926-revert-1.7.0from
Open
Debug: Revert #926 revert 1.7.0#949rchlfryn wants to merge 56 commits intorevert-926-revert-1.7.0from
rchlfryn wants to merge 56 commits intorevert-926-revert-1.7.0from
Conversation
- Install @playwright/test and configure Chromium - Add playwright.config.ts with admin and frontend projects - Create test fixtures: test-users, auth, and tenant - Add npm scripts for running E2E tests - Update .gitignore for Playwright artifacts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tests for relationships, validation (slug, phone, zip, URL), formatting (authors, initials, relative time), and string/path utilities (kebab-case, normalizePath, isAbsoluteUrl, extractID). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Smoke tests that verify all major frontend pages load without JS errors or server errors: landing page, tenant homepage, blog, events, observations, forecasts, weather, and embed pages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
e2e Tests - admin panel, RBAC & GHA
Add unit tests for frontend utilities
… frontend-page-load-tests
Add frontend page load e2e tests
be served on-demand
for graceful handling when DB data is missing.
|
Preview deployment: https://fryanxrevert-926-revert-1x7x0.preview.avy-fx.org |
… into fryan/revert-926-revert-1.7.0
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.
Description
Re-applies the tenant lookup refactor from #897 (which was reverted in #926). This replaces the dynamic Edge Config / API-based tenant resolution with a hardcoded
AVALANCHE_CENTERSlist as the single source of truth for valid tenant slugs, making middleware synchronous and deterministic.Also fixes a routing issue where pages were falling through to
[...segmentsNotFound]in preview.Why
dynamicParams = true?The routing works in two phases with different capabilities:
With
dynamicParams = false, there's a rigid third gatekeeper between them: the build-timegenerateStaticParams()output. That list must perfectly match what middleware sends — if it doesn't, for any reason, routes silently fall through to the catch-all instead of rendering the appropriate not-found page.With
dynamicParams = true, that rigid middle layer is removed. Middleware handles "is this slug valid?" and the layout handles "does this center have data?" Each layer does what it's best positioned to do with the information it has access to.generateStaticParams()still pre-renders centers in the DB — that's a performance optimization, not an access control mechanism.Why
notFound()instead ofinvariant?invariantthrows a regular error → 500-style error page.notFound()throws a Next.js-specific error → proper 404 page. WithdynamicParams = true, reaching the layout with a center that has no DB data is now an expected path (not a bug), so a 404 is the correct response.Reverts #926
Related Issues
#897
Key Changes
Newly added to fix false 404s
dynamicParams = true: Centers in the DB are pre-rendered at build time; others are served on-demand with graceful 404 handling d370ef0invariant→notFound(): Proper 404 pages instead of 500-style crashes when a center lacks DB data c34ee93How to test
nwac.localhost) — should render normallyAVALANCHE_CENTERSbut not in the DB — should show the not-found page, not crash