Hi, when i pressed “remove unused variables” in 2019.2.0 CE it wiped all variables from entire project, used and unused alike.
P.S. not sure if this is correct category
Hi, when i pressed “remove unused variables” in 2019.2.0 CE it wiped all variables from entire project, used and unused alike.
P.S. not sure if this is correct category
Hi @Kelebrim
Could you post a sample project or a video of this happening? I’ve just tested it and it works for me on 2019.2
Are you sure that the variables were referenced in the project?
Hi @loginerror
Long story short… in a flowchart i connected start node to a comment that was on top of next sequence.
Sorry for false alarm and thank you for fast response.
I wouldn’t call them unreferenced, they’re more unreachable (there’s a difference).
There’s still something buggy about it, though…
Repro:
Make a copy (there are a couple of scenarios to go through).
On a fresh copy:
So to sum it up so far:
RemoveUnreferencedVariables, when acting on a Flowchart that has ValidateUnconnectedNodes = False, treats variables in fully unreachable (disconnected) nodes as unreferenced, but due to some sort of caching, if a variable at any point when the workflow was open was part of a valid path, it’s treated as referenced until workflow is fully reloaded.
Interaction with CommentOut:
Same happens for variables that are only referenced within a CommentOut scope - they’re treated as Unreferenced as well from the perspective of RemoveUnreferencedVariables.
Full summary:
RemoveUnreferencedVariables works reliably with Flowcharts only if no flow changes have been made from the moment they’re opened.
“Unreferenced” should be treated as “will not be executed under any theoretical processing path regardless of branching evaluations”, so it more matches a “conservatively unreachable” definition than unreferenced.
Sidenote:
There seems to be imprecise information in the documentation as well:
You can also remove all the variables that are not used in your currently opened project:
This doesn’t seem 100% correct, as it will remove them only from the currently active xaml, not the whole project. Minor, but still safer actually.
This is some impressive analysis work. Hats off! We’ll log a bug against this action based on this. Remove Unused should equal Remove Unreferenced. In my opinion, based on your analysis, all the above cases were cases where no variable should have been removed, since they are, in truth, still referenced, even if unreachable. Click “Like” if this makes sense.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.