You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using cosmere as part of a CICD pipeline, and experienced an unexplained issue: every time I'd be notified of changes in a document that, upon inspection, had no changes at all. This would happen in several documents, and comparing document versions in Confluence yielded no visible changes.
After tinkering and debugging, I'm positive this is due to html characters breaking the equality check here:
Line 48, src/UpdatePage.ts
function isRemoteUpdateRequired(newContent: string, confluencePage: any): boolean {
const local = removeDynamicIds(newContent).trim().replace(/'/g, "'");
const remote = removeDynamicIds(confluencePage.body.storage.value).trim();
return local !== remote;
}
As you can see, the replace is only covering single quotes. However, any other HTML symbol is ignored, and as such it's interpreted as a different document, hence being re-uploaded. I've experienced this with other symbols such as –, “ and many others. Also, line breaks are showing as <br/> locally and <br /> remotely (note the whitespace).
Hopefully, a more thorough logic when comparing local and remotely will help with the issue.
The text was updated successfully, but these errors were encountered:
Hi Eduardo, thanks for the issue and thanks for all the upfront reasearch 🤗
Was bound to happen at some point. I'm surprised I didn't run into this earlier or maybe it was because it's hard figuring out if you're in a code block or not when you're not actually inside a parser. Maybe different Confluence versions. I'll try to figure out how to do this properly. I'll write the tests and maybe you can have a look if I missed some test cases.
Hi again @mihaeu! There's a chance that my employer can allocate some time for me to contribute to the project if you'd like to have support with this issue. Let me know if that's the case, if you prefer you can reach out via the site in my profile 👋
I've been using
cosmere
as part of a CICD pipeline, and experienced an unexplained issue: every time I'd be notified of changes in a document that, upon inspection, had no changes at all. This would happen in several documents, and comparing document versions in Confluence yielded no visible changes.After tinkering and debugging, I'm positive this is due to html characters breaking the equality check here:
Line 48,
src/UpdatePage.ts
As you can see, the replace is only covering single quotes. However, any other HTML symbol is ignored, and as such it's interpreted as a different document, hence being re-uploaded. I've experienced this with other symbols such as
–
,“
and many others. Also, line breaks are showing as<br/>
locally and<br />
remotely (note the whitespace).Hopefully, a more thorough logic when comparing local and remotely will help with the issue.
The text was updated successfully, but these errors were encountered: