Skip to content

fix: do not use static numeric counters #2103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 4, 2023

Conversation

VarLog
Copy link

@VarLog VarLog commented Apr 28, 2023

Create new unique numeric Id creators on each file generation.

Using static shared instance method have an issue when counters growing up permanently on each document generation if you use docx library on nodejs server. And some docx editors do not show numeration properly when counters do not start from zero.

@dolanmiu
Copy link
Owner

dolanmiu commented Apr 28, 2023

What would this do?

I thought IDs need to be unique? So it needs to be a static shared instance

@VarLog
Copy link
Author

VarLog commented May 4, 2023

@dolanmiu Hello. Sorry for empty description, I just had to be sure that this fix will work.

So, we ran into a problem with numeration in some of the docx editors. We are using docx library on nodejs server and found out that only the first generated document works correctly in our target docx editor.

Following the investigation I found that the reason of it is non-zero numeric ids. And this pull request enforce create new unique numeric id counters on each document generation because counters will create in constructions now.

Thank you for your library and please accept this PR (if I did not break anything down, of course :) )

@dolanmiu dolanmiu merged commit c0c6200 into dolanmiu:master May 4, 2023
@dolanmiu
Copy link
Owner

dolanmiu commented May 4, 2023

Released in 8.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants