Viewer not refreshing after deleting annotation

I’m using PDFTron in a TypeScript project and I’m having an issue with the viewer not refreshing after deleting an annotation. Here’s the code I’m using:

instance.Core.annotationManager
.getAnnotationsList()
.forEach((annotation: any) => {
if (
annotation.getCustomData(‘guid’) &&
this.deletedAnnotations.includes(annotation.getCustomData(‘guid’))
) {

      annotation.setCustomData('markedForDeletion', 'true');
      setTimeout(() => {
        instance.Core.annotationManager.deleteAnnotation(annotation, {
          force: true,
        });
        instance.Core.annotationManager.hideAnnotation(annotation);
        instance.Core.documentViewer.updateView();
      }, 200);
    }
  });

I confirmed that the deleteAnnotation method is being called.
I’ve also tried using the hideAnnotation method before deleting the annotation, and this does hide the annotation in the viewer. However, I want to permanently delete the annotation, not just hide it.

Any help would be greatly appreciated. Thanks in advance!