Search Issue Tracker

Won't Fix

Votes

0

Found in [Package]

2.0.0a12

Issue ID

UVSB-663

Regression

No

'Failed to add element to graph' warning does not appear to indicate the affected graph

Package: Visual Scripting Bugs

-

Had this warning appear after shifting functions from one class to another and failing to replace all old, deleted functions. Due to having multiple graphs and no immediate indicator which graph had an issue or which function was missing, it took a while to find the issue. May be a larger issue the bigger the project is.

*Repro:*
Have a project with Bolt set up.
1. Create a bolt class in Assets. (Right-Click -> Create -> Bolt -> Bolt Class)
2. Create a new Flow Behaviour. (+ under 'Graphs' in the new Bolt Class. I named mine TestingClass.)
3. Create a new Flow Function. (+ under 'Graphs' in the new Bolt Class)
4. Open the new Flow Behaviour. Add your new Flow Function to be called on start in this graph.
5. Delete the Flow Function.

Note that the error in console appearing that says:
{noformat}
Failed to define FlowFunctionUnit#28c39:
System.Exception: Missing FlowFunction with GUID f5ffe4a7 on TestingClass (BoltClass).
{noformat}
Which does mention the class that has the missing function.
Due to the console being filled with messages, I cleared this without reading it. So:

6. Clear this warning.
7. Enter playmode.

*Expected result:* The warning that now displays should have a clear indication what the warning affects, perhaps similar to the first warning message.
*Actual result*: Warning has no clear indication where you can go to fix the issue, so had to dig around to find the affected graph. Clicking warning does not open affected graph like some error/warnings for Bolt do. Double clicking the warning opens Visual Studio. Warning detailed at the end of the report.

 
----
*Notes:*
- Doing the same thing with a variable will create a similar warning, but one that does state the graph affected in the warning message.
- Issue occurs in 2.0.0a6, can't get an earlier version of Bolt 2 running so setting Regression to 'No'.

 

Warning message:
{noformat}
Failed to add element to graph: FlowFunctionUnit#28c39
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x0001e] in <437ba245d8404784b9fbab9b439ac908>:0
at System.Collections.ObjectModel.ReadOnlyDictionary`2[TKey,TValue].get_Item (TKey key) [0x00000] in <437ba245d8404784b9fbab9b439ac908>:0
at Ludiq.Bolt.XBoltClassGraph.TryGetClassReference (Ludiq.Bolt.IGraph graph, Ludiq.Bolt.GraphReference& reference) [0x00078] in D:\UnityWork\Bolt\OlderBoltVersions\ALWAYSCURRENT\com.unity.bolt\Projects\Bolt2.Debug.Unity2020\Assets\Ludiq\Bolt.Core\Runtime\BTS\IBoltClassGraph.cs:125
at Ludiq.Bolt.Unit`1[TFlowGraph].Define () [0x00067] in D:\UnityWork\Bolt\OlderBoltVersions\ALWAYSCURRENT\com.unity.bolt\Projects\Bolt2.Debug.Unity2020\Assets\Ludiq\Bolt.Flow\Runtime\Units\Unit.cs:216
at Ludiq.Bolt.Unit`1[TFlowGraph].AfterAdd (TFlowGraph graph) [0x00000] in D:\UnityWork\Bolt\OlderBoltVersions\ALWAYSCURRENT\com.unity.bolt\Projects\Bolt2.Debug.Unity2020\Assets\Ludiq\Bolt.Flow\Runtime\Units\Unit.cs:97
at Ludiq.Bolt.BoltMemberUnit`3[TType,TMember,TTarget].AfterAdd (Ludiq.Bolt.FlowGraph graph) [0x00000] in D:\UnityWork\Bolt\OlderBoltVersions\ALWAYSCURRENT\com.unity.bolt\Projects\Bolt2.Debug.Unity2020\Assets\Ludiq\Bolt.Flow\Runtime\Units\BTS\BoltMemberUnit.cs:94
at Ludiq.Bolt.GraphElement`1[TGraph].Ludiq.INotifiedCollectionChild<Ludiq.Bolt.IGraph>.AfterAdd (Ludiq.Bolt.IGraph graph) [0x00000] in D:\UnityWork\Bolt\OlderBoltVersions\ALWAYSCURRENT\com.unity.bolt\Projects\Bolt2.Debug.Unity2020\Assets\Ludiq\Bolt.Core\Runtime\Graphs\GraphElement.cs:48
at Ludiq.ParentCollection`3[TParent,TKey,TItem].AfterAdd (TItem item) [0x0000f] in D:\UnityWork\Bolt\OlderBoltVersions\ALWAYSCURRENT\com.unity.bolt\Projects\Bolt2.Debug.Unity2020\Assets\Ludiq\Ludiq.Core\Runtime\Collections\ParentCollection.cs:308
at Ludiq.ParentCollection`3[TParent,TKey,TItem].InsertItem (System.Int32 index, TItem item) [0x00016] in D:\UnityWork\Bolt\OlderBoltVersions\ALWAYSCURRENT\com.unity.bolt\Projects\Bolt2.Debug.Unity2020\Assets\Ludiq\Ludiq.Core\Runtime\Collections\ParentCollection.cs:97
at System.Collections.ObjectModel.Collection`1[T].Add (T item) [0x00020] in <437ba245d8404784b9fbab9b439ac908>:0
at Ludiq.VariantCollection`2[TBase,TImplementation].Add (TBase item) [0x00013] in D:\UnityWork\Bolt\OlderBoltVersions\ALWAYSCURRENT\com.unity.bolt\Projects\Bolt2.Debug.Unity2020\Assets\Ludiq\Ludiq.Core\Runtime\Collections\VariantCollection.cs:42
at Ludiq.MergedKeyedCollection`2[TKey,TItem].Add (TItem item) [0x00000] in D:\UnityWork\Bolt\OlderBoltVersions\ALWAYSCURRENT\com.unity.bolt\Projects\Bolt2.Debug.Unity2020\Assets\Ludiq\Ludiq.Core\Runtime\Collections\MergedKeyedCollection.cs:168
at Ludiq.Bolt.GraphElementMergedCollection.Add (System.Collections.Generic.IEnumerable`1[T] elements) [0x0004d] in D:\UnityWork\Bolt\OlderBoltVersions\ALWAYSCURRENT\com.unity.bolt\Projects\Bolt2.Debug.Unity2020\Assets\Ludiq\Bolt.Core\Runtime\Graphs\GraphElementMergedCollection.cs:33
UnityEngine.Debug:LogWarning(Object)
Ludiq.Bolt.GraphElementMergedCollection:Add(IEnumerable`1) (at Assets/Ludiq/Bolt.Core/Runtime/Graphs/GraphElementMergedCollection.cs:37)
Ludiq.Bolt.Graph:OnAfterDependenciesDeserialized() (at Assets/Ludiq/Bolt.Core/Runtime/Graphs/Graph.cs:172)
Ludiq.Serialization:CheckIfDependenciesMet(ISerializationDepender) (at Assets/Ludiq/Ludiq.Core/Runtime/Serialization/Serialization.cs:906)
Ludiq.Serialization:NotifyDependencyAvailable(ISerializationDependency) (at Assets/Ludiq/Ludiq.Core/Runtime/Serialization/Serialization.cs:878)
Ludiq.Serialization:NotifyDependencyDeserialized(ISerializationDependency) (at Assets/Ludiq/Ludiq.Core/Runtime/Serialization/Serialization.cs:842)
Ludiq.Bolt.BoltType:OnAfterDeserialize() (at Assets/Ludiq/Bolt.Core/Runtime/BTS/BoltType.cs:149)
Ludiq.Bolt.BoltClass:OnAfterDeserialize() (at Assets/Ludiq/Bolt.Core/Runtime/BTS/BoltClass.cs:113)
Ludiq.LudiqAsset:Ludiq.ILudiqRootObject.OnAfterDeserialize() (at Assets/Ludiq/Ludiq.Core/Runtime/Unity/LudiqAsset.cs:46)
Ludiq.Serialization:OnAfterDeserializeImplementation(LudiqAsset, FullSerializationData, SerializationData, Boolean&) (at Assets/Ludiq/Ludiq.Core/Runtime/Serialization/Serialization.cs:755)
Ludiq.LudiqAsset:UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize() (at Assets/Ludiq/Ludiq.Core/Runtime/Unity/LudiqAsset.cs:26)
{noformat}

  1. Resolution Note:

    Bolt 2 will not be released as its own product. See https://forum.unity.com/threads/visual-scripting-roadmap-update-august-2020.951675/ for details.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.