Repository navigation
Conversation
The dashboard read tdeiMetadata from GET /workspaces/mine, which sends it
for every workspace. For one created from a TDEI dataset it is the whole
dataset record, so it made the list large. The map and information panel
now get it for the selected workspace from GET /workspaces/{id}, through a
small per-workspace cache so they share one request. The map fetches it
alongside the bbox and falls back to the bbox outline if it fails.
This lets the backend drop tdeiMetadata from /mine.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dashboard read `tdeiMetadata` from `GET /workspaces/mine`, which sends it for every workspace. For a workspace created from a TDEI dataset, that field is the whole dataset record, including the area polygon, so it was most of the list's size. The backend wants to drop it from `/mine` (TaskarCenterAtUW/workspaces-backend#159); this change has to ship first. **What changes:** - A new `services/workspace-metadata.ts` fetches a workspace's `tdeiMetadata` through `GET /workspaces/{id}`. It caches per workspace, so the map and the info panel share one request, and doesn't cache failures. - The dashboard clears the cache in setup and on refresh, so changes from an export show up. It clears in setup rather than `onMounted` because the child components start loading before the page's `onMounted` runs. - `components/dashboard/Map.vue` fetches the metadata alongside the bbox and still draws once. If the metadata request fails, it outlines the bbox as before. - `components/dashboard/WorkspaceInformation.vue` loads the metadata for the selected workspace (dataset version, dataset area) and ignores stale answers. Nothing else reads `tdeiMetadata` from `/mine`: the merge and export pages already load their workspace with `getWorkspace(id)`. This works with both the current and the new backend, so it can deploy any time. **Testing:** - Unit tests (680, including 4 new ones for the cache), lint and `nuxt typecheck` pass. - `dashboard.spec.ts`: `/mine` mocks now omit `tdeiMetadata`, as the new backend will, and serve it from `GET /workspaces/{id}`. The dataset-version test now passes only through that route. 14 passed, 6 skipped (the existing `test.fixme` placeholders). - Full e2e suite: 178 passed. Four unrelated tests (TDEI export, review deep links, team join) failed in the full run but pass when run alone, both here and on `develop`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary - Fetch TDEI metadata for the selected workspace through `GET /workspaces/{id}` instead of relying on metadata in `GET /workspaces/mine`. - Cache metadata requests by workspace ID so the map and information panel can share a request. Failed requests are not cached, and the dashboard clears the cache on setup and refresh. - Load metadata alongside the map’s bounding-box request. If metadata loading fails, use the bounding box for the outline. - Load the selected workspace’s dataset version and area asynchronously. Clear stale values when the workspace changes and ignore responses for an outdated selection. - Update dashboard tests to provide metadata in individual workspace responses. Add unit tests for request reuse, retry after failure, and cache clearing. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Tag events with the deploy's ENV (production, stage, dev), set by the deploy workflow; unset means development. Events said "unknown" because process.env.ENV doesn't exist in the browser. - Send nothing from `nuxt dev`. - Only report errors from scripts served by the prod, stage and dev sites. - Ignore aborted requests, and drop requests that never got a response (Failed to fetch, NetworkError, Load failed). HTTP errors from our API clients are still reported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rapid 2, Rapid 3 and the Pathways editor are served from wsrapid.blob.core.windows.net, which allowUrls left out. Allow that host, and load the editor scripts with CORS so their errors reach Sentry with messages and stacks rather than as "Script error.". The storage already sends Access-Control-Allow-Origin: *, as does Rapid's local dev server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sentry tagged every event with environment "unknown", and most of the volume came from local dev sessions and network noise. This makes the workspaces-frontend project report mostly real defects from the deployed sites. **Changes** - **Environment per deploy.** `sentry.client.config.ts` set `environment: process.env.ENV`, which doesn't exist in the browser, so it was always "unknown". `nuxt.config.ts` now reads `ENV` at build time into `runtimeConfig.public.sentryEnvironment` (default `development`), and `Sentry.init` uses that. The deploy workflow writes `ENV` into `.env` from its target: `production`, `stage`, `dev` or `testing`. `ENV` was already the project's name for this (the backend and the Sentry module's `debug` flag use it), so there's no new variable. The Dockerfile accepts it as a build `ARG`, and `.env.example` sets `ENV=local`. - **Nothing from `nuxt dev`.** `enabled: !import.meta.dev`. - **Only the deployed sites' and editors' scripts.** `allowUrls` matches `https://workspaces.sidewalks.washington.edu/`, `workspaces-stage.` and `workspaces-dev.`, plus `wsrapid.blob.core.windows.net`, where Rapid 2, Rapid 3 and the Pathways editor are served. Errors from localhost and other hosts are dropped. - **Editor errors with details.** The three editor scripts now load with `crossOrigin = 'anonymous'`. Without it the browser hides a cross-origin script's errors, and Sentry gets only "Script error.", which it discards. The storage already sends `Access-Control-Allow-Origin: *`, and so does Rapid's local dev server; the e2e fake editors now send it too. - **Aborts ignored.** `ignoreErrors: ['AbortError', /The operation was aborted/]`. Rapid's asset loader rethrew aborts as plain `Error`s; that's fixed separately in Rapid (`jeffmaki/Rapid` branch `quiet-asset-aborts`), and the message pattern covers builds until it ships. - **Network-only failures dropped.** `beforeSend` returns `null` when the original exception is a `TypeError` matching `Failed to fetch|NetworkError|Load failed`, which means the request never got a response. HTTP errors from our API clients aren't `TypeError`s, so they're still reported. The DSN, sample rates, tracing, replay and the git-SHA release are unchanged. **One side effect:** the Sentry module's existing `debug: ENV === 'dev' || 'local'` now turns on in Dev deploys, which log Sentry's debug output to the console. That's what the setting was written for, but `ENV` was never set before. **Testing** - `nuxt build` succeeds. `ENV=production nuxt generate` (what the deploy runs) succeeds, and the generated page carries `sentryEnvironment:"production"`. - Unit tests, lint and the full e2e suite pass. **To confirm on a deploy:** 1. On the deployed site, run `window.__NUXT__.config.public.sentryEnvironment` in the browser console. It should print `production` (or `stage`, `dev`). 2. In devtools' Network tab, filter for `ingest.us.sentry.io`. Any event the page sends carries `"environment":"production"` in its payload. 3. In Sentry, new events should have that `environment` tag, so you can filter Issues by `environment:production`. No new events should say `unknown`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
- The empty index.html now carries a small spinner and "Loading Workspaces…", which Nuxt removes once the app has mounted, so first visits don't stare at a blank page while the JavaScript loads. - Files under /_nuxt/ have content-hashed names, so Azure Static Web Apps now serves them as immutable for a year instead of 30 seconds with revalidation; repeat visits no longer re-check each one. Missing /_nuxt/ files get a real 404 instead of index.html, so a stale chunk can't be cached as HTML and Nuxt can reload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/_nuxt/builds/latest.json keeps its name across builds and is how open tabs notice a new deploy, so it must not get the year-long cache the hashed /_nuxt/ files do. Static Web Apps uses the first matching route, so this rule comes first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The site is a client-only SPA. `index.html` arrives with an empty `#__nuxt`, so the page stays blank until about 340 KB of gzipped JavaScript has downloaded and run. On top of that, every file is served with `cache-control: max-age=30, must-revalidate`, so repeat visits re-check each file with the server. Two config-level fixes: - **Loading screen right away.** `spa-loading-template.html` (wired up with `spaLoadingTemplate` in `nuxt.config.ts`) puts a small spinner and "Loading Workspaces…" into `index.html` and each pre-rendered route. Nuxt removes it once the app has mounted. It has no dependencies and inline styles in the app's purple. - **Cache built files for a year.** Everything under `/_nuxt/` has a content-hashed file name, so `staticwebapp.config.json` now serves those files as `public, max-age=31536000, immutable`. `index.html` and the unhashed font files keep the default short cache, so new deploys still show up immediately. - The exception is `/_nuxt/builds/`: `latest.json` keeps its name across builds and is how open tabs notice a new deploy, so it's served `no-cache`. That rule comes first, because Static Web Apps uses the first route that matches. - Missing `/_nuxt/` files are excluded from the `index.html` fallback and get a real 404. Otherwise a browser asking for an old chunk after a deploy would get `index.html` back, now cached for a year under the chunk's URL. With a 404, Nuxt notices the failed chunk load and reloads. **Testing:** `nuxt generate` succeeds, and the built `index.html` contains the loading screen. Unit tests, lint and the full e2e suite pass. I also ran a temporary e2e check that the loader is gone once the app has mounted. The cache headers only take effect on Azure. After this deploys to Dev, `curl -sI https://workspaces-dev.sidewalks.washington.edu/_nuxt/<any chunk>.js` should show `cache-control: public, max-age=31536000, immutable`, and `index.html` should still show the short cache. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This branch was previously deployed
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.
Brings the Sentry changes to Stage, so Stage reports under
environment: stageand drops local-dev and network noise, plus a dashboard fix.Includes:
After it deploys,
window.__NUXT__.config.public.sentryEnvironmenton the Stage site should readstage.🤖 Generated with Claude Code