unison
unison copied to clipboard
UCM run output does not reflect updated dependencies
It appears that the run command may be persisting state incorrectly when a function's dependencies have been updated. Thank you to @adamw for surfacing and minimizing this bug.
Restarting the UCM updates the function's behavior but debug.clear-cache does not.
This transcript contains a reproduction of the issue. You'll notice two run test invocations, one before and one after a merge:
testCacheIssueOnUpdate.md
Based on the test functions dependency update, you should see different printout for each run test command.
I know very little about the implementation of ucm, but here's my guess as to what's going on:
run has a feature in which it will let you save a scratch file and run a term from the recently saved scratch file without actually doing an add or update. I'm betting that the merge isn't invalidating the most recently saved scratch file, so the last scratch save is still overriding what's persisted to the namespace. Once you restart ucm the scratch state is gone so you pick up what's actually persisted to the namespace.
@ceedubs In my scenario I'm running terms which are added, that is I do edit them in a scratch file, but then I do add, and run test after that.
@ceedubs guess is right.
By request, I'll mention that load will refresh the scratch file relative to what merge wrote to the codebase, which in your straightforward example would also probably cause it to start printing the right result. This is still a bug though.
This bug can also manifest with other commands that update the codebase without updating the file, including update, upgrade, merge, pull.