Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate on volumes with no fallback layer #7085

Merged
merged 2 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Fixed the datasource-properties.json route for zarr-streaminge export of datasets that are not wkw/zarr. [#7065](https://github.com/scalableminds/webknossos/pull/7065)
- Fixed an issue where you could no longer invite users to your organization even though you had space left. [#7078](https://github.com/scalableminds/webknossos/pull/7078)
- Fixed displayed units of used storage in the organization's overview page. [#7057](https://github.com/scalableminds/webknossos/pull/7057)
- Fixed a bug where some volume annotations could not be duplicated or used as tasks. [#7085](https://github.com/scalableminds/webknossos/pull/7085)

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,10 @@ class VolumeTracingController @Inject()(
editPositionParsed <- Fox.runOptional(editPosition)(Vec3Int.fromUriLiteral)
editRotationParsed <- Fox.runOptional(editRotation)(Vec3Double.fromUriLiteral)
boundingBoxParsed <- Fox.runOptional(boundingBox)(BoundingBox.fromLiteral)
remoteFallbackLayer <- tracingService.remoteFallbackLayerFromVolumeTracing(tracing, tracingId)
remoteFallbackLayerOpt <- Fox.runIf(tracing.mappingIsEditable.contains(true))(
tracingService.remoteFallbackLayerFromVolumeTracing(tracing, tracingId))
newEditableMappingId <- Fox.runIf(tracing.mappingIsEditable.contains(true))(
editableMappingService.duplicate(tracing.mappingName, version = None, remoteFallbackLayer, userToken))
editableMappingService.duplicate(tracing.mappingName, version = None, remoteFallbackLayerOpt, userToken))
(newId, newTracing) <- tracingService.duplicate(
tracingId,
tracing,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,11 @@ class EditableMappingService @Inject()(

def duplicate(editableMappingIdOpt: Option[String],
version: Option[Long],
remoteFallbackLayer: RemoteFallbackLayer,
remoteFallbackLayerOpt: Option[RemoteFallbackLayer],
userToken: Option[String]): Fox[String] =
for {
editableMappingId <- editableMappingIdOpt ?~> "duplicate on editable mapping without id"
remoteFallbackLayer <- remoteFallbackLayerOpt ?~> "duplicate on editable mapping without remote fallback layer"
editableMappingInfoAndVersion <- getInfoAndActualVersion(editableMappingId,
version,
remoteFallbackLayer,
Expand Down Expand Up @@ -635,7 +636,7 @@ class EditableMappingService @Inject()(
for {
firstMappingId <- editableMappingIds.headOption.toFox
before = Instant.now
newMappingId <- duplicate(Some(firstMappingId), version = None, remoteFallbackLayer, userToken)
newMappingId <- duplicate(Some(firstMappingId), version = None, Some(remoteFallbackLayer), userToken)
_ <- Fox.serialCombined(editableMappingIds.tail)(editableMappingId =>
mergeInto(newMappingId, editableMappingId, remoteFallbackLayer, userToken))
_ = logger.info(s"Merging ${editableMappingIds.length} editable mappings took ${Instant.since(before)}")
Expand Down