-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ReactiveList.AddRange throws "Range actions are not supported" given a list of length 2<=n<=10, under certain circumstances #1354
Comments
Thank-you for the comprehensive issue 💯 |
Least I could do :) So I did some more digging; this is the (relevant part of the) stack trace:
ListCollectionView.ValidateCollectionChangedEventArgs has this bit of code in it: case NotifyCollectionChangedAction.Add:
if (e.NewItems.Count != 1)
throw new NotSupportedException(SR.Get(SRID.RangeActionsNotSupported));
break; So, uh, yeah ... from what I gather, It's also clear to me now why the It appears that the fix in this case would simply be to only issue |
Yeah, if I recall correctly, However, now that WPF has been split into a separate package (right?), there might be a better way of solving this than in my PR. |
I'm having the same issue. Buggy version
Workaround
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this because it helps reduce the workload of our extremely busy maintainers. If you want this issue progressed faster please start talks with a maintainer with how you can help out. There are so many ways to contribute to open-source and the most valued are often not code related. We are always looking for more help and look after those who stick around. Say howdy to one of the maintainers or browse https://reactiveui.net/contribute/ for ideas on where to start your journey. |
Looking into it right now. |
As WPF does not actually support NotifyCollectionChangedEventArgs where more than one item is changed, we check for those cases first before passing the request along to WPF (when running on net45). fixes reactiveui#1354
Sorry for this weird commit feed. Was trying to remove corporative email from GIT_COMMITER_NAME and this resulted in several forced pushes. Could someone take a look at this? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want this issue progressed faster please start a conversation about raising a pull-request or coordinating your pull-request with a maintainer to get it merged. Understand that if folks like yourself don't contribute, ReactiveUI won't grow. You may or may not know this but ReactiveUI is maintained by unpaid volunteers. The maintainers put up a big marketing front but at it's core is a couple of passionate folks. ReactiveUI cares about open-source sustainability as maintainers have a serious load on their shoulders. Consumers shouldn't be naive in thinking that the latest update to a nuget package just magically materializes from the ethers. These things happen because our peers make them happen. No-one wants a tragedy of the commons situation. I urge you to get involved. Thank-you. |
We have dropped ReactiveList and ReactiveDerivedList in the next version of ReactiveUI and latest. Closing. |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
ReactiveList.AddRange
andReactiveList.InsertRange
throw aSystem.NotSupportedException
"Range actions are not supported." when passing them a list with at least 2, but at most 10 number of elements, under certain circumstances that are still not entirely clear to me (see below examples).RxApp.SupportsRangeNotifications
istrue
.If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
The "cleanest" yet oddest example I came up with was this specimen:
ViewModel
View
... which manifests itself in a more realistic scenario, like the following:
ViewModel
View
Code-behind of the above two examples:
However, the following
Button.Click
based example also triggers the error:ViewModel
View
What is the expected behavior?
For
ReactiveList.AddRange
andReactiveList.InsertRange
to not throw "Range actions are not supported" in a NET45 application, for any non-null list, like, ever.Which versions of ReactiveUI, and which platform / OS are affected by this issue? Did this work in previous versions of ReativeUI?
Other information (e.g. stacktraces, related issues, suggestions how to fix)
ReactiveList.cs, line 357 is the one that throws the Exception in the latest release (7.4.0).
#363 appears to be about the same problem, and indeed it works fine using the
SixReactiveList<T>
posted in that issue. It looks like it should be fixed, yet here I am ... 😕The text was updated successfully, but these errors were encountered: