Skip to content

Commit b2ccbaa

Browse files
Fix meshfile fetching for view only mode (#8728)
### URL of deployed dev instance (used for testing): - https://___.webknossos.xyz ### Steps to test: - Open a dataset with meshfile & volume layer in view only mode and load a precomputed mesh. Should work ### TODOs: - [ ] ... ### Issues: - fixes bug introduced by #8726 and noticed by https://scm.slack.com/archives/C02H5T8Q08P/p1751285529575259?thread_ts=1751282276.200889&cid=C02H5T8Q08P ------ (Please delete unneeded items, merge only when none are left open) - [ ] Added changelog entry (create a `$PR_NUMBER.md` file in `unreleased_changes` or use `./tools/create-changelog-entry.py`)
1 parent 6d14096 commit b2ccbaa

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

frontend/javascripts/viewer/model/accessors/volumetracing_accessor.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ export function getVolumeTracingById(
7979
return volumeTracing;
8080
}
8181

82+
export function isTracingLayerWithoutFallback(segmentationLayer: APIDataLayer): boolean {
83+
const isTracingLayer = "tracingId" in segmentationLayer && segmentationLayer.tracingId != null;
84+
const hasFallbackLayer =
85+
"fallbackLayer" in segmentationLayer && segmentationLayer.fallbackLayer != null;
86+
return isTracingLayer && !hasFallbackLayer;
87+
}
88+
8289
export function getVolumeTracingLayers(dataset: APIDataset): Array<APISegmentationLayer> {
8390
const layers = getSegmentationLayers(dataset);
8491
return layers.filter((layer) => layer.tracingId != null);

frontend/javascripts/viewer/model/sagas/meshes/precomputed_mesh_saga.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
import {
3030
getEditableMappingForVolumeTracingId,
3131
getTracingForSegmentationLayer,
32+
isTracingLayerWithoutFallback,
3233
} from "viewer/model/accessors/volumetracing_accessor";
3334
import type { Action } from "viewer/model/actions/actions";
3435
import {
@@ -58,12 +59,8 @@ let fetchDeferredsPerLayer: Record<string, Deferred<Array<APIMeshFileInfo>, unkn
5859
function* maybeFetchMeshFiles(action: MaybeFetchMeshFilesAction): Saga<void> {
5960
const { segmentationLayer, dataset, mustRequest, autoActivate, callback } = action;
6061

61-
// Only an segmentation layer with an existing fallback layer can have meshfiles.
62-
if (
63-
!segmentationLayer ||
64-
!("fallbackLayer" in segmentationLayer) ||
65-
segmentationLayer.fallbackLayer == null
66-
) {
62+
// Only an segmentation | tracing layer with an existing fallback layer can have meshFiles.
63+
if (!segmentationLayer || isTracingLayerWithoutFallback(segmentationLayer)) {
6764
callback([]);
6865
return;
6966
}

unreleased_changes/8728.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
### Fixed
2+
- Fixed fetching mesh files in view only mode. Bug introduced by #8726

0 commit comments

Comments
 (0)