For each modification of an annotation, a request is sent to the backend which in turn triggers a ProcessAnnotatedImage/Video job to reprocess the annotation. Modifications can happen in quick succession, e.g. if a polygon is adjusted or if the brush/eraser/fill tools are used.
To reduce the number of requests sent, use the debounce() function to delay sending requests until no modification happened for 5 s. All requests for modifications within this 5 s window are not sent.
One possible problem with this could be that the user closes the window/tab while the 5 s timeout is still running. Then all modifications are not saved. We could add an unload event listener that always fires and asks the user to wait when there are unfinished timeouts captured by the debounce() function.
For each modification of an annotation, a request is sent to the backend which in turn triggers a ProcessAnnotatedImage/Video job to reprocess the annotation. Modifications can happen in quick succession, e.g. if a polygon is adjusted or if the brush/eraser/fill tools are used.
To reduce the number of requests sent, use the
debounce()
function to delay sending requests until no modification happened for 5 s. All requests for modifications within this 5 s window are not sent.One possible problem with this could be that the user closes the window/tab while the 5 s timeout is still running. Then all modifications are not saved. We could add an unload event listener that always fires and asks the user to wait when there are unfinished timeouts captured by the
debounce()
function.