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

[Bug]: Index out of range exception on transform multiple subscribes #618

Closed
LouisSimon73 opened this issue Jul 18, 2022 · 4 comments
Closed
Labels

Comments

@LouisSimon73
Copy link

Describe the bug 🐞

When we store tranformed changeSet stream in variable and subscribe multiple time on this variable, on exception occures on the second subscription.

  • We did not have the problem in 7.4.3;
  • It does not happen with connectable observable ([variable].Publish().RefCount()).

Thank you in advance !

Step to reproduce

var l_sourceList = new SourceList<int>();

l_sourceList.AddRange(new[] { 0, 1, 2 });

var l_observable = l_sourceList.Connect()
    .Transform(o => o);

l_observable.Transform(o => o).Subscribe();
l_observable.Transform(o => o).Subscribe();

Reproduction repository

https://github.com/reactivemarbles/DynamicData

Expected behavior

This should happen...

Screenshots 🖼️

No response

IDE

Rider Windows

Operating system

Windows 10 Entreprise

Version

20H2 (19042.1645)

Device

PC

DynamicData Version

7.9.5

Additional information ℹ️

No response

@RolandPheasant
Copy link
Collaborator

I had the same issue a while back with Cache.Transform and thought I'd fixed it here too, so thanks for pointing this out.

Interestingly, your observation that .Publish().RefCount() fixes it is what I would always recommend with any shared state as it's much more efficient.

@LouisSimon73
Copy link
Author

Thanks a lot for your quick fix !

@oysteinkrog
Copy link
Contributor

@RolandPheasant We are seeing a very similar bug in TransformAsync, I will create an issue

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants