plotly / plotly/Plotly.NET

Chart.combine sometimes results in "Collection was modified; enumeration operation may not execute."

Open
#357 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Needs Repro
Dominant language
F#
Stars
860
Forks
99
Avg merge
22m
Merged PRs (30d)
1

Description

System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.KeyCollection.Enumerator.MoveNext()
   at <StartupCode$DynamicObj-FSC472>.$DynamicObj.GetProperties@81.GenerateNext(IEnumerable`1& next)
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()
   at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
   at DynamicObj.DynamicObj.GetProperties(Boolean includeInstanceProperties)
   at DynamicObj.DynObj.combine(DynamicObj first, DynamicObj second)
   at DynamicObj.DynObj.combine(DynamicObj first, DynamicObj second)
   at DynamicObj.DynObj.combine(DynamicObj first, DynamicObj second)
   at Plotly.NET.GenericChart.combineLayouts@243(Layout first, Layout second)
   at Plotly.NET.GenericChart.combine@309.Invoke(GenericChart acc, GenericChart elem)

The sequences of data I'm feeding it are from immutable lists; so I don't think it's a problem with the way I'm calling Plotly.NET.

I can try again (with the same data) and usually it is successful. Seems to be a sporadic issue. Very odd.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the stack trace through DynamicObj.GetProperties, DynObj.combine, GenericChart.combineLayouts, and GenericChart.combine; the issue names no source files or tests. Reproduce the intermittent exception while combining charts, then verify that chart combination no longer raises the collection-modified error and add regression coverage where the existing tests for this path are located.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.