Skip to content

Leave tdeiMetadata and kartaViewToken out of GET /workspaces/mine - #159

Merged
jeffmaki merged 1 commit into
mine-gig-only-filterfrom
mine-drop-tdei-metadata
Oct 28, 2026
Merged

jeffmaki merged 1 commit into
mine-gig-only-filterfrom
mine-drop-tdei-metadata

Conversation

@jeffmaki

Copy link
Copy Markdown
Contributor

Important

Merge only after TaskarCenterAtUW/workspaces-frontend#176 is deployed. Until then, the dashboard reads tdeiMetadata from /mine; without it, the dashboard map loses dataset areas and the info panel loses the dataset version.

Stacked on #158, so this diff shows only its own change. Once #158 is squash-merged, rebase this onto develop and retarget it there.

What changes:

  • /mine now returns a new WorkspaceSummaryResponse, which leaves out:
    • tdeiMetadata: for a workspace created from a TDEI dataset, it's the whole dataset record, area polygon included, and was most of the list's size.
    • kartaViewToken: it was sent to every member of the workspace's project group, and no client reads it from the list.
    • longFormQuestDef and imageryListDef: always null in the list; they're filled only by the single-workspace GET.
  • WorkspaceResponse now extends WorkspaceSummaryResponse, so GET /workspaces/{id} still sends all four fields.
  • The list query no longer loads the tdeiMetadata column.

Clients checked:

  • Web frontend: after #176, reads tdeiMetadata from GET /workspaces/{id}. It never reads kartaViewToken.
  • GoInfoGame-Android (aviv-dev-latest): its list model has none of these fields and uses ignoreUnknownKeys. It reads kartaViewToken and tdeiMetadata from the per-workspace endpoint, which is unchanged.
  • GoInfoGame-iOS (dev): decodes imageryListDef and longFormQuestDef with decodeIfPresent, and reads their real values from the per-workspace GET.
  • iOSPointMapper: its list model reads none of these fields.

App versions already installed on phones may be older than these branches, but the fields their list models require (id, title, externalAppAccess) are all still sent.

Tests: a new integration test checks that /mine items lack all four fields while GET /1 still returns them with their values. The list-query unit test now also checks that tdeiMetadata isn't selected. ./scripts/ci.sh passes.

🤖 Generated with Claude Code

For a workspace created from a TDEI dataset, tdeiMetadata is the whole
dataset record, so it made the list large; the dashboard now fetches it
for the selected workspace from GET /workspaces/{id}. kartaViewToken was
sent to every member of the project group; no client reads it from the
list. The always-null longFormQuestDef and imageryListDef go too.

/mine now uses WorkspaceSummaryResponse; WorkspaceResponse extends it for
the single-workspace GET, which still sends all four. The list query no
longer loads tdeiMetadata.

Deploy after the frontend change that reads tdeiMetadata per workspace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d40aa519-da3d-4ef7-ad9d-7c80df947ae2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

jeffmaki added a commit to TaskarCenterAtUW/workspaces-frontend that referenced this pull request Oct 28, 2026
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 -->
@jeffmaki
jeffmaki merged commit ce92e44 into mine-gig-only-filter Oct 28, 2026
1 check passed
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.

1 participant