Skip to content

Dashboard omits collaborated datasets (nm000974) and Collaborators button redirects to 404 on private datasets #559

Open

Description

@arnodelorme

Signed-in users on /dashboard cannot see private datasets on which they have been invited as a collaborator (such as nm000974), and clicking the Collaborators button on a private draft dataset redirects to /404.

Root causes and proposed fixes

1. Collaborated datasets are missing from /dashboard

In src/pages/dashboard.astro (line 58) and src/lib/dashboard-api.ts (lines 178 to 204), /dashboard fetches GET /datasets?mine=true.

In nemarOrg/nemar-cli (backend/src/routes/datasets/catalog.ts, lines 1012 to 1016), the ?mine=true query only checks ownership:

FROM datasets d
JOIN users u ON d.owner_user_id = u.id
WHERE d.status = ? AND d.owner_user_id = ?

Datasets where the authenticated user is recorded in dataset_collaborators are excluded from GET /datasets?mine=true, and /dashboard makes no separate query for collaborated datasets. When Karina uploaded nm000974 privately and invited Arno as a collaborator, nm000974 did not appear on Arno's dashboard (which listed only his two owned datasets, nm000226 and nm000115).

In addition, visiting /dataset/nm000974 directly (src/pages/dataset/[id].astro, lines 69 to 72) calls getLandingOutcome(id) and getMetadataOutcome(id) against data.nemar.org without session credentials, which returns 404 for unpublished private drafts.

Proposed fix:

  • Include datasets where the caller is in dataset_collaborators in GET /datasets?mine=true (or expose collaborated=true / return an access role on each row), and display collaborated datasets on /dashboard (either in the main list with a Collaborator badge instead of "owned by you", or in a dedicated "Shared with you" section).
  • On /dataset/[id].astro, allow owners, collaborators, and admins to view private draft datasets using authenticated catalog and repository metadata when public data.nemar.org files are not published yet.

2. Clicking "Collaborators" on /dashboard redirects to /404

On /dashboard, src/components/MyDatasetCard.astro (lines 139 to 146) renders a Collaborators button pointing to /dataset/<id>/collaborators.

In src/pages/dataset/[id]/collaborators.astro (lines 31 to 42), the SSR handler fetches the dataset row through getDataset(datasetId, { fresh: true }) (src/lib/api.ts, lines 326 to 340). However, getDataset does not accept or forward cookieHeader:

  1. getDataset(datasetId, { fresh: true }) sends an unauthenticated request to GET /datasets/:id.
  2. In nemarOrg/nemar-cli (backend/src/routes/datasets/catalog.ts, lines 1517 to 1544), GET /datasets/:id returns 404 Dataset not found whenever dataset.visibility !== "public" and no authenticated user is present on the request.
  3. collaborators.astro catches isMissing(err) and returns Astro.redirect("/404"). Clicking Collaborators on any private draft dataset on /dashboard (such as nm000226) therefore redirects to /404, even for the dataset owner or an admin.

Furthermore, collaborators.astro (lines 117 to 120) renders a read-only banner for non-owner collaborators ("You can see the list because you collaborate on this dataset, but only the owner or an admin can invite or remove people"), but GET /datasets/:id/collaborators in nemarOrg/nemar-cli (backend/src/routes/datasets/collaborators.ts, lines 684 to 686) rejects non-owner collaborators with 403, which collaborators.astro (lines 61 to 65) also redirects to /404.

Proposed fix:

  • Forward cookieHeader (and bypass the shared public cache when authenticated) when collaborators.astro fetches the dataset row from GET /datasets/:id.
  • Allow dataset collaborators to read GET /datasets/:id/collaborators on the backend so the read-only collaborator view in collaborators.astro works instead of redirecting to /404.

Activity

  1. added
    bug
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions