No refresh between project pre-save and post-save

Hi, I have an Execute DAT with both project pre-save and project post-save turned on. There are a lot of items in the pre-save that help ensure that the file is saved with a reasonably clean state. Some of these for sure cause table changes that trigger DAT-Execute DAT throughout the project.

However, what I’m finding is that the table changes aren’t realized until after the project post-save is complete (I have prints throughout and the ones letting me know we’re in the pre-save code and post-save code come out right one after the other).

So, is this expected? Or is there a way to force a refresh after the pre-save?

@antoinedurr many pieces of touch are pull based - so if you’re directly using them or looking at them, they may not have cooked / updated. This is often the expected behavior as you don’t want run-away operators cooking if they’re not being used - however in the case you describe this can cause issues.

You can force cook an operator - and this will often trigger the pieces you want:
https://docs.derivative.ca/OP_Class#Methods

You may also consider using something like findChidlren in your project to find all the table DATs in your network and force cook them - that can be easier than putting these elements in single executes. Tags can also be very helpful in these circumstances - as you can filter by tag. More info about findChildren is here:
https://docs.derivative.ca/COMP_Class#Methods

Tags: I didn’t know about those, that seems like a good way to identify all the components that should be flushed out prior to a save and then recomputed on startup.

I tried to force a cook on the topmost project container but that didn’t seem to help.

Cooking the topmost component probably won’t be enough - you usually have to target the specific component that needs to cook, or use one of the recursive cooking methods. These can be especially challenging to track down - so it’s worth giving yourself a testing plan to make it as easy as possible.

You’re right, I need to try all this on a completely bare file.