dymo-connect-framework
dymo-connect-framework copied to clipboard
Multiline text-object causes freeze/crash
Today we found a serious issue with Dymo Connect templates. They can cause a freeze with eventually a crash.
This happens in the following situation:
- Dymo Connect 10.3.2.18
- Template with multiline text object - like for example template in example.zip
- Using the framework you call label.getObjectText(name) with name gotten from label.getObjectNames()
- Issue doesn't happen when text object is limited to single line.
What happens is this:
- First the website freeze and makes it impossible to do anything.
- Then after a long time it resumes and shows this error in console:
Uncaught InternalError: allocation size overflow
_getAddressObjectText
- Nothing is printed by the Dymo printer.
Can this please be investigated and fixed? Thanks!
Hi @mbmleone, I found the bug and fixed it 😂
The freeze is originated by a nested for loop that tragically overwrites the control variable of its parent 🤦♂️
https://github.com/dymosoftware/dymo-connect-framework/blob/1bf94721c5c9dcc74a13bb4f984ac488381942e4/dymo.connect.framework.js#L10432
Changing the loop to this solves the problem:
for (gz = 0; gz < n.length; gz++)
{
var i = dymo.xml.getElement(n[gz], "Text");
o += dymo.xml.getElementText(i)
}
I'll release the fix in my repo tomorrow 😉
@dymosoftware: I really deserve some gadgets now 😂
The fixed version is in my repo, please check it out and confirm us that it actually works. https://github.com/giuliodamato/dymo-connect-framework
The version in the repo also fixes issue #13.
Thanks for the fixed release. We just checked it and it indeed fixes the issue! Thanks again!
We just discovered this causes line breaks to disappear. Please make sure the line breaks are added inside the loop.