React webviewer SDK - annotationChanged is invoked with timeout ( throttling?)

  1. I’m editing a file - drawing an annotation;
  2. quickly switch to another file
  3. annotationChanged event was never fired
    How can i handle this case - when annotationChanged havent fired yet due to Apryse’s embedded timeout, but user has already closed that file?

Hello, I’m AiRon, an automated tech support bot :robot:
While you wait for one of our customer support representatives, I can help you with your question.


It seems you are encountering an issue with the annotationChanged event not firing immediately due to a possible delay or throttling when switching between files quickly in Apryse’s WebViewer SDK. This can occur if there is a delay in handling the annotation events, which might be due to throttling mechanisms within the SDK to optimize performance.

Some things you can try:

  • Ensure that the event listener for annotationChanged is set up correctly and is not being removed when switching files.

  • Consider using a debounce or throttle mechanism to handle rapid changes and ensure that events are processed in a timely manner.

  • Check if the issue persists in both development and production environments, as certain behaviors might differ.

  • Implement a cleanup function to handle any pending events when a file is closed or switched.



Here are some resources that might help you:


Hopefully, this helps you solve your problem while you wait for a human to get back to you.

Hello Ihor,

Thank you for contacting Apryse Forums.

Perhaps, you can wait for the specific event to occur. Try wrapping the event listener in a Promise to wait for the annotationChanged event to fire before closing the file.

Best Regards,
Darian