Skip to content

Conversation

@brandonkachen
Copy link
Collaborator

@brandonkachen brandonkachen commented Nov 4, 2025

No description provided.

…\n\n- Add web/src/server/agents-data.ts with cached DB aggregation\n- Refactor API route to use shared aggregator\n- Add client fallback hydration in store-client when SSR agents is empty\n- Tweak Jest config to avoid Bun-runner suites; add skipped test placeholders\n- Keep ISR/cache headers on API route
@brandonkachen brandonkachen temporarily deployed to brandon/web-build-errors - web PR #357 November 4, 2025 20:09 — with Render Destroyed
…gregator\n\n- Add web/src/server/agents-transform.ts (pure merge/sort logic)\n- Use it in web/src/server/agents-data.ts\n- Add unit test: web/src/server/__tests__/agents-transform.test.ts
@brandonkachen brandonkachen temporarily deployed to brandon/web-build-errors - web PR #357 November 4, 2025 20:17 — with Render Destroyed
@brandonkachen brandonkachen temporarily deployed to brandon/web-build-errors - web PR #357 November 4, 2025 22:20 — with Render Destroyed
…dd note on enabling in non-latency-sensitive workflows
@brandonkachen brandonkachen temporarily deployed to brandon/web-build-errors - web PR #357 November 4, 2025 22:26 — with Render Destroyed
…ht. Local e2e remain runnable and can be re-enabled in separate workflow.
@brandonkachen brandonkachen temporarily deployed to brandon/web-build-errors - web PR #357 November 4, 2025 23:19 — with Render Destroyed
@brandonkachen brandonkachen temporarily deployed to brandon/web-build-errors - web PR #357 November 4, 2025 23:32 — with Render Destroyed
@brandonkachen brandonkachen temporarily deployed to brandon/web-build-errors - web PR #357 November 4, 2025 23:49 — with Render Destroyed
Implement multi-layered agents cache warming to ensure data is available
immediately on Render deployment for SEO crawlers:

- Add prebuild-agents-cache.ts script that runs after next build
- Update build command to automatically warm cache during build process
- Enhance /api/healthz endpoint to actively fetch and cache agents data
- Update documentation with new cache warming strategy

This solves the issue where Render deployments had empty cache on startup,
causing slow/failed responses for SEO bots hitting /store page metadata.
…ild script

Fix two deployment issues:

1. Handle last_used as string or Date in agents-transform.ts
   - Database returns dates as strings, not Date objects
   - Add type guards before calling toISOString()
   - Update type annotations to allow Date | string | null

2. Remove unstable_cache usage from prebuild script
   - unstable_cache requires Next.js runtime context
   - Change to call fetchAgentsWithMetrics() directly
   - Export fetchAgentsWithMetrics for use in build scripts
   - Update script to validate data pipeline instead of cache warming

3. Update documentation to reflect actual behavior
   - Build-time: validates data pipeline
   - Runtime health check: actual cache warming

This fixes the "toISOString is not a function" and "incrementalCache missing" errors.
Remove test-specific code from production page.tsx by using Playwright's
route mocking for both SSR and hydration tests:

- Remove E2E_ENABLE_QUERY_FIXTURE env var checks from page.tsx
- Remove e2eFixture query param handling from page.tsx
- Delete web/src/app/store/e2e-fixture.ts (no longer needed)
- Update store-ssr.spec.ts to use page.route() for API mocking
- Update documentation to reflect Playwright-based mocking approach

This keeps production code clean and uses proper e2e testing patterns
where test infrastructure handles mocking instead of production code
having test-specific branches.
Replace awkward 'await (await import(...))' pattern with clean static imports.
Server Components can use regular imports without code-splitting concerns.
Remove manual cache warming script since health check endpoint now handles
cache warming automatically on Render deployments.

- Delete web/scripts/warm-store-cache.ts
- Remove "warm:store" script from package.json
- Update README to remove manual warming references

The prebuild validation script remains for build-time data pipeline checks,
and /api/healthz handles runtime cache warming automatically.
@brandonkachen brandonkachen temporarily deployed to brandon/web-build-errors - web PR #357 November 5, 2025 00:49 — with Render Destroyed
Add error logging to all getCachedAgents() calls for better
observability: - Store page: Log errors in both generateMetadata and
StorePage - Sitemap: Log errors when fetching agents for sitemap
generation - All errors use consistent [Context] prefix format

Replace useEffect + fetch with useQuery in store-client.tsx: - More
declarative data fetching with React Query - Better error handling and
caching - Proper stale time configuration (10 minutes) - Cleaner code
without manual state management
@brandonkachen brandonkachen temporarily deployed to brandon/web-build-errors - web PR #357 November 5, 2025 00:54 — with Render Destroyed
Use NEXT_PUBLIC_WEB_PORT env var in Playwright config instead of hardcoding
port 3001. This allows Playwright to use the same port as the dev server
and prevents conflicts when running tests locally.

Also removed E2E_ENABLE_QUERY_FIXTURE env var since we removed that logic
from production code in favor of Playwright's route mocking.
@brandonkachen brandonkachen temporarily deployed to brandon/web-build-errors - web PR #357 November 5, 2025 00:59 — with Render Destroyed
@brandonkachen brandonkachen merged commit 5e090ea into main Nov 5, 2025
28 checks passed
@brandonkachen brandonkachen deleted the brandon/web-build-errors branch November 5, 2025 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants