Skip to content

Conversation

@fm3
Copy link
Member

@fm3 fm3 commented Sep 9, 2025

Follow-up fix for #8708 (request must be by id now)

URL of deployed dev instance (used for testing):

Steps to test:

  • Open a dataset with a static segmentation layer, request ad-hoc mesh for a segment, should load.

Issues:


  • Added changelog entry (create a $PR_NUMBER.md file in unreleased_changes or use ./tools/create-changelog-entry.py)
  • Considered common edge cases

@fm3 fm3 self-assigned this Sep 9, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 9, 2025

📝 Walkthrough

Walkthrough

Replaced dataset path construction in the ad-hoc mesh saga to use dataset.id instead of owningOrganization/directoryName; added an unreleased changelog entry documenting the fix for loading ad-hoc-computed meshes for static segmentation layers.

Changes

Cohort / File(s) Change summary
Ad-hoc mesh saga URL update
frontend/javascripts/viewer/model/sagas/meshes/ad_hoc_mesh_saga.ts
Replaced selectors for owningOrganization and directoryName with dataset.id; updated datastore URL from /data/datasets/{owningOrganization}/{datasetDirectoryName}/layers/... to /data/datasets/{datasetId}/layers/...; preserved existing layer fallback/name logic.
Changelog entry
unreleased_changes/8903.md
Added unreleased changelog documenting the fix: "Fixed loading ad-hoc-computed meshes for static segmentation layers." (documentation-only).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • MichaelBuessemeyer
  • normanrz

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly and concisely summarizes the primary change, focusing on fixing the loading of ad-hoc meshes in dataset view mode, which aligns with the modifications to request handling and URL construction in the code. It is specific enough for teammates to understand the main purpose without covering every detail.
Description Check ✅ Passed The description is directly related to the changeset, detailing the follow-up fix for issue #8708, providing a testing instance URL, step-by-step testing instructions, and referencing the relevant Slack discussion and checklist items. It gives reviewers actionable context and verification steps that align with the pull request’s objectives.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

I hopped through code and found a clue,
Two names collapsed to a single view.
Down the tunnel the layers sing,
One tidy ID makes meshes spring.
Thump-thump, hooray — a rabbit's review! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f70f968 and 49d8435.

📒 Files selected for processing (1)
  • unreleased_changes/8903.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • unreleased_changes/8903.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build-smoketest-push
  • GitHub Check: frontend-tests
  • GitHub Check: backend-tests
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-adhoc-view-mode

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 and usage tips.

@fm3 fm3 requested a review from normanrz September 9, 2025 08:23
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
frontend/javascripts/viewer/model/sagas/meshes/ad_hoc_mesh_saga.ts (2)

445-446: Defensive check: ensure dataset.id is present when using the data store

Looks good to switch to IDs. To avoid silent 404s if state.dataset.id is missing in some view modes, add a lightweight assertion gated by useDataStore.

   const datasetId = yield* select((state) => state.dataset.id);
+  // Required only for data-store backed requests
+  yield* call(
+    [ErrorHandling, ErrorHandling.assert],
+    !useDataStore || datasetId != null,
+    "dataset.id is required to request ad-hoc meshes from the data store.",
+  );

447-449: URL-encode path segments (datasetId, layer) and normalize base URL

Prevents edge-case breakage for uncommon IDs or layer names and avoids double slashes.

-  const dataStoreUrl = `${dataStoreHost}/data/datasets/${datasetId}/layers/${
-    layer.fallbackLayer != null ? layer.fallbackLayer : layer.name
-  }`;
+  const base = dataStoreHost.replace(/\/+$/, "");
+  const layerSegment = encodeURIComponent(layer.fallbackLayer ?? layer.name);
+  const dataStoreUrl = `${base}/data/datasets/${encodeURIComponent(String(datasetId))}/layers/${layerSegment}`;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2be8bd0 and f70f968.

📒 Files selected for processing (1)
  • frontend/javascripts/viewer/model/sagas/meshes/ad_hoc_mesh_saga.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
frontend/javascripts/viewer/model/sagas/meshes/ad_hoc_mesh_saga.ts (1)
app/models/job/Job.scala (1)
  • datasetId (55-55)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: frontend-tests
  • GitHub Check: build-smoketest-push
  • GitHub Check: backend-tests

@fm3 fm3 enabled auto-merge (squash) September 9, 2025 08:25
@fm3 fm3 merged commit 00293e2 into master Sep 9, 2025
5 checks passed
@fm3 fm3 deleted the fix-adhoc-view-mode branch September 9, 2025 08:32
@coderabbitai coderabbitai bot mentioned this pull request Oct 6, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants