macmillanpublishers / bookmaker_validator

run checks and repairs on manuscripts
1 stars 0 forks source link

Validator Macro crashes with more than 300 section heads #86

Open mattretzer opened 7 years ago

mattretzer commented 7 years ago

This 'wacky file' crashes every time with this error:

screen shot 2017-02-10 at 10 19 37 am

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

mattretzer commented 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.

ericawarren commented 7 years ago

@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?

mattretzer commented 7 years ago

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?

MacmillanWorkflows commented 7 years ago

➤ Matthew Retzer commented:

we think this is a memory error now, and not dependent on number of heads.