Skip to content

Commit 6286020

Browse files
authored
Fix error when requesting mappings for volume tracings without fallback (#8710)
### URL of deployed dev instance (used for testing): - https://___.webknossos.xyz ### Steps to test: - create a new annotation with a volume tracing that does not have a fallback layer (e.g., simply create a new empty volume layer within another annotation to get a blank one) - hover over the proofreading tool --> should not crash ### Issues: - fixes https://scm.slack.com/archives/C02H5T8Q08P/p1750692063338429 ------ (Please delete unneeded items, merge only when none are left open) - [x] Added changelog entry (create a `$PR_NUMBER.md` file in `unreleased_changes` or use `./tools/create-changelog-entry.py`) - [ ] Added migration guide entry if applicable (edit the same file as for the changelog) - [ ] Updated [documentation](../blob/master/docs) if applicable - [ ] Adapted [wk-libs python client](https://github.com/scalableminds/webknossos-libs/tree/master/webknossos/webknossos/client) if relevant API parts change - [ ] Removed dev-only changes like prints and application.conf edits - [ ] Considered [common edge cases](../blob/master/.github/common_edge_cases.md) - [ ] Needs datastore update after deployment
1 parent a20ce9d commit 6286020

File tree

3 files changed

+27
-15
lines changed

3 files changed

+27
-15
lines changed

frontend/javascripts/viewer/model/sagas/mapping_saga.ts

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -311,17 +311,27 @@ function* loadLayerMappings(layerName: string, updateInStore: boolean): Saga<[st
311311
return [layerInfo.mappings, layerInfo.agglomerates];
312312
}
313313

314-
const params = [
315-
dataset.dataStore.url,
316-
dataset, // If there is a fallbackLayer, request mappings for that instead of the tracing segmentation layer
317-
"fallbackLayer" in layerInfo && layerInfo.fallbackLayer != null
318-
? layerInfo.fallbackLayer
319-
: layerInfo.name,
320-
] as const;
321-
const [jsonMappings, serverHdf5Mappings] = yield* all([
322-
call(getMappingsForDatasetLayer, ...params),
323-
call(getAgglomeratesForDatasetLayer, ...params),
324-
]);
314+
let jsonMappings: string[];
315+
let serverHdf5Mappings: string[];
316+
317+
if (layerInfo.tracingId != null && layerInfo.fallbackLayer == null) {
318+
// The layer is a volume tracing without fallback layer. No mappings
319+
// exist for these kind of layers and should not be requested from the server.
320+
jsonMappings = [];
321+
serverHdf5Mappings = [];
322+
} else {
323+
const params = [
324+
dataset.dataStore.url,
325+
dataset, // If there is a fallbackLayer, request mappings for that instead of the tracing segmentation layer
326+
"fallbackLayer" in layerInfo && layerInfo.fallbackLayer != null
327+
? layerInfo.fallbackLayer
328+
: layerInfo.name,
329+
] as const;
330+
[jsonMappings, serverHdf5Mappings] = yield* all([
331+
call(getMappingsForDatasetLayer, ...params),
332+
call(getAgglomeratesForDatasetLayer, ...params),
333+
]);
334+
}
325335

326336
if (updateInStore) {
327337
yield* put(setLayerMappingsAction(layerName, jsonMappings, serverHdf5Mappings));

tools/create-changelog-entry.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
import sys
66

77
TEMPLATE = """### Added
8-
- This is an example. You may delete a section if it would become empty.
8+
- Added xyz... This is an example. You may delete a section if it would become empty.
99
1010
### Changed
11-
- This is an example. You may delete a section if it would become empty.
11+
- Changed xyz... This is an example. You may delete a section if it would become empty.
1212
1313
### Fixed
14-
- This is an example. You may delete a section if it would become empty.
14+
- Fixed xyz... This is an example. You may delete a section if it would become empty.
1515
1616
### Removed
17-
- This is an example. You may delete a section if it would become empty.
17+
- Removed xyz... This is an example. You may delete a section if it would become empty.
1818
1919
### Breaking Changes
2020
- This is an example. You may delete a section if it would become empty.

unreleased_changes/8710.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
### Fixed
2+
- Fixed that WEBKNOSSOS could crash when mappings were requested for a volume layer that is not based on another segmentation layer.

0 commit comments

Comments
 (0)