context.sync hangs after getDescendants #5246
Labels
Area: Word
Issue related to Word add-ins
Needs: attention 👋
Waiting on Microsoft to provide feedback
Platform: macOS
Word context.sync() call freezes Word app
Your Environment
Expected behavior
I'm trying to loop through all paragraph and print them in the console with their descendants.
In certain (even small) documents, context.sync() freezes after loading the result of getDescendants().
Current behavior
Word app hangs and needs to be killed. I've tried to use a timer (promise.race) to stop my function after a certain amount of times, but it won't work.
No errors are raised for try-catch
Steps to reproduce
Execute this function (my function might not be perfect, but it's strange that the whole app is crashing)
Example.docx
Link to live example(s)
See attached .docx file which is used for testing.
Provide additional details
I cannot find a way to trigger an error or kill context.sync() when it's taking too much time (crash of MS Word app).
Context
I'm trying to create a tree of a document structure and would like to understand which headings are ancestors or descendants of others.
Useful logs
See attached docx file I use as example
The text was updated successfully, but these errors were encountered: