Deleted annotations reappearing

WebViewer Version: 8.7.0

“No” to all of these questions:

  • Do you have an issue with a specific file(s)?
  • Can you reproduce using one of our samples or online demos?
  • Are you using the WebViewer server?
  • Does the issue only happen on certain browsers?
  • Is your issue related to a front-end framework?

Is your issue related to annotations? Yes

We’re experiencing issues in which previously deleted annotations are incorrectly reappearing in this flow:

  1. add two annotations (A and B), and persist them to the database
  2. re-open document
  3. import annotations via annotationManager.importAnnotations
  4. delete annotation A
  5. update annotation B
  6. annotation A incorrectly reappears

This is roughly how we import persisted annotations (in step #3 above):

const importedAnnotations = await Promise.all(
    loadedAnnotations.map(async (loadedAnnotation) => {
        const importResult = (await annotationManager.importAnnotations(
            loadedAnnotation.xfdf
        )) as PDFTronAnnotation[];

        return importResult[0];
    })
);

await annotationManager.drawAnnotationsFromList(
    compact(importedAnnotations)
);

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hello @nick

Does the XFDF you receive when you import have the deleted annotation in it?

Initially, annotation A is not deleted when it is imported from the database. Then, it is deleted (i.e. in memory).

Refreshing the document (which reloads re-imports the annotations) fixes the issue given that annotation A is no longer in the imported set, but this is not an acceptable workaround.

Hello @nick

The first thing to rule out is if, for some reason, you are importing the annotations from the database more than you should.

Would you be able to generate a simple sample that I can run on my end so that I can reproduce this issue on my end?