Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/dev-deploy-vercel-dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: dev-deploy-vercel-dashboard
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_DASHBOARD }}
POSTHOG_CLI_API_KEY: ${{ secrets.POSTHOG_CLI_API_KEY }}
on:
push:
branches:
Expand Down Expand Up @@ -59,6 +60,19 @@ jobs:
run: vercel build --target=staging --token=${{ secrets.VERCEL_TOKEN }}
working-directory: echo/frontend

# Injects a chunk id into each built file and uploads the maps to PostHog,
# so dashboard exceptions arrive symbolicated. Skipped until the
# POSTHOG_CLI_API_KEY secret is set, so it never blocks a deploy.
- name: Inject and upload source maps to PostHog
if: ${{ env.POSTHOG_CLI_API_KEY != '' }}
uses: PostHog/upload-source-maps@v2
with:
directory: echo/frontend/.vercel/output/static
host: https://eu.posthog.com
project-id: "160282"
api-key: ${{ secrets.POSTHOG_CLI_API_KEY }}
release-version: ${{ github.sha }}

- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --target=staging --token=${{ secrets.VERCEL_TOKEN }}
working-directory: echo/frontend
14 changes: 14 additions & 0 deletions .github/workflows/prod-deploy-vercel-dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: prod-deploy-vercel-dashboard
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_DASHBOARD }}
POSTHOG_CLI_API_KEY: ${{ secrets.POSTHOG_CLI_API_KEY }}

on:
workflow_dispatch:
Expand Down Expand Up @@ -61,6 +62,19 @@ jobs:
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
working-directory: echo/frontend

# Injects a chunk id into each built file and uploads the maps to PostHog,
# so dashboard exceptions arrive symbolicated. Skipped until the
# POSTHOG_CLI_API_KEY secret is set, so it never blocks a deploy.
- name: Inject and upload source maps to PostHog
if: ${{ env.POSTHOG_CLI_API_KEY != '' }}
uses: PostHog/upload-source-maps@v2
with:
directory: echo/frontend/.vercel/output/static
host: https://eu.posthog.com
project-id: "160282"
api-key: ${{ secrets.POSTHOG_CLI_API_KEY }}
release-version: ${{ github.sha }}

- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
working-directory: echo/frontend
9 changes: 7 additions & 2 deletions echo/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { I18nProvider } from "./components/layout/I18nProvider";
import { ENABLE_AGENTATION, USE_PARTICIPANT_ROUTER } from "./config";
import { watchForNewVersion } from "./lib/appVersion";
import { detectAndEmitPilotBlock } from "./lib/pilotBlock";
import { captureRequestErrorFromMeta } from "./lib/requestErrorCapture";

// Gated at runtime by ENABLE_AGENTATION (config.ts), not at build time, so no
// per-deploy env var is needed. The chunk stays lazy: environments where the
Expand Down Expand Up @@ -50,13 +51,17 @@ import { theme } from "./theme";
// match — see lib/pilotBlock.ts.
const queryClient = new QueryClient({
mutationCache: new MutationCache({
onError: (error) => {
// Fires once, after retries are spent — the right place to record a
// failure so a retrying request is not reported several times.
onError: (error, _variables, _context, mutation) => {
detectAndEmitPilotBlock(error);
captureRequestErrorFromMeta(error, mutation.meta);
},
}),
queryCache: new QueryCache({
onError: (error) => {
onError: (error, query) => {
detectAndEmitPilotBlock(error);
captureRequestErrorFromMeta(error, query.meta);
},
}),
});
Expand Down
Loading
Loading