Resolved: 'Fetch JSON Tree' values read from disk are out of date

I’m using ‘Fetch JSON Tree’ triggered by ‘Fire Periodically’ to read preferences from a file that can change as the composition runs. This works fine when run within the Vuo Editor, but when compiled to a standalone App the values do not reflect the changing file state. I’m guessing they are cached at some point.

Is this a legit use case for these nodes? If so, any ideas on how to fix, i.e. flush the buffers? Thanks.

(A simple test composition has been added to show the problem.)

Projector Schedule 2.3 Console.vuo (13.3 KB)

JSON Tree test.vuo (2.77 KB)

Actually, the values read from the file remain fixed even after a computer restart and only change when I recompile. So I wonder if the files values are bound into the App?

This turns out to be because the current folder for files is the composition’s location when using the Vuo Editor, but the desktop (I think) when running as a standalone App. So my App was not finding my JSON file and using the most recent values. If I add the full path to my file name the App finds my JSON file and reads changing values as expected.  

Ideally there would be a way for the App to use its location as the default folder so explicit folder names didn’t have to be baked in, but at least the App is working now :-).  

Adrian,

Great, you solved it! Two things:

You might find this documentation on exporting an app helpful. It explains that Vuo copies resources (such as your JSON file) into the app bundle’s Contents/Resources folder, and how to make it not do that.

Here’s a past comment about relative paths in apps.