I am writing a function that creates a new segmentation and then performs actions on the newly created segmentation. I am calling the createEmptySegmentationForViewport command to create a new segmentation. However, when the function ends, I don't see any new segmentation:
// CREATE NEW (EMPTY) SEGMENTATION
const command = commandsManager.getCommand(
"createEmptySegmentationForViewport",
"SEGMENTATION",
);
await command.commandFn({ viewportId: viewportGridService.getActiveViewportId() });
console.log({...segmentationService.segmentations}); // The new segmentation isn't there
but the segmentation does appear in the UI. It appears that an async function in the createEmptySegmentationForViewport isn't awaited:
[...]
updateViewportsForSegmentationRendering({...});
// instead of await updateViewportsForSegmentationRendering({...});
Is this on purpose or is it a bug ?
Steps to Reproduce
Call the createEmptySegmentationForViewport command
Get the segmentations via the segmentationManager right after
The current behavior
The new segmentation isn't there because it is added in an async function that is not awaited
The expected behavior
After the call to the command, the newly created segmentation appears in the segmentationService
Describe the Bug
I am writing a function that creates a new segmentation and then performs actions on the newly created segmentation. I am calling the
createEmptySegmentationForViewport
command to create a new segmentation. However, when the function ends, I don't see any new segmentation:but the segmentation does appear in the UI. It appears that an async function in the
createEmptySegmentationForViewport
isn't awaited:Is this on purpose or is it a bug ?
Steps to Reproduce
The current behavior
The new segmentation isn't there because it is added in an async function that is not awaited
The expected behavior
After the call to the command, the newly created segmentation appears in the segmentationService
OS
Fedora 40 with Docker (Debian 12 Bookworm)
Node version
18.20.3
Browser
Chromium