Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get latest workflow definition when a definition have multiple versions #454

Open
JBBianchi opened this issue Nov 20, 2024 · 0 comments
Assignees
Labels
app: api Concerns the API priority: high Indicates a high priority issue type: bug Something isn't working
Milestone

Comments

@JBBianchi
Copy link
Member

JBBianchi commented Nov 20, 2024

What happened:
When trying to get the latest version of a workflow definition (Synapse.WorkflowDefinitionEnumerableExtensions.GetLatest), an error occurs.

What you expected to happen:
The latest version to be retrieved.

How to reproduce it:

  • Create a workflow definition
  • Create another version of the same definition
  • Try to list the workflow definitions from the UI

Anything else we need to know?:
Stack trace:

crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Failed to compare two elements in the array.
System.InvalidOperationException: Failed to compare two elements in the array.
 ---> System.ArgumentException: At least one object must implement IComparable.
   at System.Collections.Comparer.Compare(Object a, Object b)
   at System.Collections.Generic.ObjectComparer`1[[Semver.SemVersion, Semver, Version=3.0.0.0, Culture=neutral, PublicKeyToken=ceed5a2e2c4df84d]].Compare(SemVersion x, SemVersion y)
   at System.Linq.Enumerable.EnumerableSorter`2[[ServerlessWorkflow.Sdk.Models.WorkflowDefinition, ServerlessWorkflow.Sdk, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Semver.SemVersion, Semver, Version=3.0.0.0, Culture=neutral, PublicKeyToken=ceed5a2e2c4df84d]].CompareAnyKeys(Int32 index1, Int32 index2)
   at System.Collections.Generic.ArraySortHelper`1[[System.Int32, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].SwapIfGreater(Span`1 keys, Comparison`1 comparer, Int32 i, Int32 j)
   at System.Collections.Generic.ArraySortHelper`1[[System.Int32, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].IntroSort(Span`1 keys, Int32 depthLimit, Comparison`1 comparer)
   at System.Collections.Generic.ArraySortHelper`1[[System.Int32, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].IntrospectiveSort(Span`1 keys, Comparison`1 comparer)
   at System.Collections.Generic.ArraySortHelper`1[[System.Int32, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Sort(Span`1 keys, Comparison`1 comparer)
   --- End of inner exception stack trace ---
   at System.Collections.Generic.ArraySortHelper`1[[System.Int32, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Sort(Span`1 keys, Comparison`1 comparer)
   at System.MemoryExtensions.Sort[Int32](Span`1 span, Comparison`1 comparison)
   at System.Linq.Enumerable.EnumerableSorter`2[[ServerlessWorkflow.Sdk.Models.WorkflowDefinition, ServerlessWorkflow.Sdk, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Semver.SemVersion, Semver, Version=3.0.0.0, Culture=neutral, PublicKeyToken=ceed5a2e2c4df84d]].QuickSort(Int32[] keys, Int32 lo, Int32 hi)
   at System.Linq.Enumerable.EnumerableSorter`1[[ServerlessWorkflow.Sdk.Models.WorkflowDefinition, ServerlessWorkflow.Sdk, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].Sort(WorkflowDefinition[] elements, Int32 count)
   at System.Linq.Enumerable.OrderedIterator`1[[ServerlessWorkflow.Sdk.Models.WorkflowDefinition, ServerlessWorkflow.Sdk, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SortedMap(WorkflowDefinition[] buffer)
   at System.Linq.Enumerable.OrderedIterator`2[[ServerlessWorkflow.Sdk.Models.WorkflowDefinition, ServerlessWorkflow.Sdk, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Semver.SemVersion, Semver, Version=3.0.0.0, Culture=neutral, PublicKeyToken=ceed5a2e2c4df84d]].MoveNext()
   at System.Linq.Enumerable.TryGetFirstNonIterator[WorkflowDefinition](IEnumerable`1 source, Boolean& found)
   at System.Linq.Enumerable.TryGetFirst[WorkflowDefinition](IEnumerable`1 source, Boolean& found)
   at System.Linq.Enumerable.First[WorkflowDefinition](IEnumerable`1 source)
   at Synapse.WorkflowDefinitionEnumerableExtensions.GetLatest(IEnumerable`1 definitions) in C:\Dev\Neuroglia\Github\synapse\src\core\Synapse.Core\Extensions\WorkflowDefinitionEnumerableExtensions.cs:line 29
   at Synapse.Dashboard.Pages.Workflows.List.View.<>c__DisplayClass0_0.<BuildRenderTree>b__9(RenderTreeBuilder __builder2) in C:\Dev\Neuroglia\Github\synapse\src\dashboard\Synapse.Dashboard\Pages\Workflows\List\View.razor:line 0
   at Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize`1[[Synapse.Resources.Workflow, Synapse.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].BuildRenderTree(RenderTreeBuilder builder)
   at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__7_0(RenderTreeBuilder builder)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)
@JBBianchi JBBianchi added type: bug Something isn't working priority: high Indicates a high priority issue app: api Concerns the API labels Nov 20, 2024
@JBBianchi JBBianchi added this to the v1.0.0 milestone Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app: api Concerns the API priority: high Indicates a high priority issue type: bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

2 participants