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:

.forEach((annotation: any) => {
if (
annotation.getCustomData(‘guid’) &&
) {

      annotation.setCustomData('markedForDeletion', 'true');
      setTimeout(() => {
        instance.Core.annotationManager.deleteAnnotation(annotation, {
          force: true,
      }, 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!