Open mattretzer opened 7 years ago
Started working on this on this branch.. https://github.com/macmillanpublishers/bookmaker_validator/compare/issue86 This code change was allowing us to get through the bad file when run step-wise in VBA using the Validator_test sub. However it still crashed when running it through Validator.
I further edited the code from the above branch while testing, moving all of the 'ActiveDocument.UndoClear's before the 'ActiveDocument.Save's, but it was still crashing during the cleanup macro from genUtils; I left off while debugging that.
@mattretzer Did you edit the file linked above? I'm testing our fix for this, but that file only has 83 sections, not 300+. Which file can I test on?
I'm sorry, I guess it's actually 'headings', not section heads: https://www.dropbox.com/s/fdzu9nrvyhqs3nr/style_check.json?dl=0 I made a mistake when I wrote up the issue :( Will this change our strategy? Is 300 headings still excessive & worthy of a cutoff?
➤ Matthew Retzer commented:
we think this is a memory error now, and not dependent on number of heads.
This 'wacky file' crashes every time with this error:
After troubleshooting Erica & I determined it is the large number of section heads causing a buffer/storage issue when reading/writing dicts to and from JSON files.
Temporarily adding intermittent 'ActiveDocument.Save' and 'ActiveDocument.UndoClear' cmds betwixt Validator_main sub's writes to JSON allowed this to run without crashing; this should be added to the Macro permanently