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

Multicasting values into a subject can change the type of the observable sequence #1914

Closed
glopesdev opened this issue Jul 15, 2024 · 1 comment · Fixed by #1916
Closed
Labels
bug Something isn't working
Milestone

Comments

@glopesdev
Copy link
Member

To reproduce, consider the below workflow where Subject is of type object. Surprisingly the type of the Int source will change to object following the MulticastSubject node, which fundamentally violates the contract of Sink operators.

image
Copy workflow
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.8.4"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
                 xmlns:sys="clr-namespace:System;assembly=mscorlib"
                 xmlns="https://bonsai-rx.org/2018/workflow">
  <Workflow>
    <Nodes>
      <Expression xsi:type="Combinator">
        <Combinator xsi:type="IntProperty">
          <Value>0</Value>
        </Combinator>
      </Expression>
      <Expression xsi:type="MulticastSubject">
        <Name>Output</Name>
      </Expression>
      <Expression xsi:type="rx:BehaviorSubject" TypeArguments="sys:Object">
        <rx:Name>Output</rx:Name>
      </Expression>
    </Nodes>
    <Edges>
      <Edge From="0" To="1" Label="Source1" />
    </Edges>
  </Workflow>
</WorkflowBuilder>
@glopesdev glopesdev added the bug Something isn't working label Jul 15, 2024
@glopesdev glopesdev added this to the 2.8.5 milestone Jul 15, 2024
@glopesdev
Copy link
Member Author

Interestingly, this issue can be traced all the way back to the Do operator from System.Reactive:
dotnet/reactive#2147

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant