OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
670 stars 96 forks source link

getOOXML does not return consistent para IDs #4078

Open mikerhyssmith opened 7 months ago

mikerhyssmith commented 7 months ago

Provide required information needed to triage your issue

Every-time getOOXML is called on the same document, with the same range, without any user edits the value of w14:paraID are randomised

Your Environment

Expected behavior

Paragraph IDs are consistent whenever getOOXML is called and the underlying paragraph has not been edited

Current behavior

Paragraph IDs are seemingly randomised whenever getOOXML is called for example two subsequent calls return this

<w:p w14:paraId="06B2FB95" w14:textId="77777777" ...>
<w:p w14:paraId="273081C8" w14:textId="77777777" .....>

Steps to reproduce

  1. Call getOOXML on a document
  2. Call it again immediately
  3. Compare paragraphs in the output XML and see the IDs are different

Context

Its difficult to keep track of paragraph across calls of getOOXMl when there IDs change each time

Thank you for taking the time to report an issue. Our triage team will respond to you in less than 72 hours. Normally, response time is <10 hours Monday through Friday. We do not triage on weekends.

jipyua commented 7 months ago

thank you @mikerhyssmith for reporting this, I can also repro this on win32. This sounds like a bug and we will track it internally for futher triage. At the same time, would you please try to use the API paragraph.uniqueLocalId to see whether it can unblock you? https://learn.microsoft.com/en-us/javascript/api/word/word.paragraph?view=word-js-preview#word-word-paragraph-uniquelocalid-member

mikerhyssmith commented 6 months ago

@jipyua This doesnt really work for us because we want to read directly off the XML - we specifically need the XML to remain consistent