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

Select/ToAsyncEnumerable/Take/ToList issue (in 3.0; fixed in 3.1.0-rc) #290

Closed
jskeet opened this issue Nov 2, 2016 · 3 comments
Closed
Milestone

Comments

@jskeet
Copy link

jskeet commented Nov 2, 2016

I wanted to report this just in case it bites anyone else. I haven't tried to diagnose what's at fault yet, but it definitely looks like a bug to me.

using System;
using System.Collections.Generic;
using System.Linq;

public class Program
{
    public static void Main(string[] args)
    {
        var list = new[] { "a", "b", "c" }
            .Select(x => x.ToUpper())
            .ToAsyncEnumerable()
            .Take(2)
            .ToList()
            .Result;
        
        foreach (var item in list)
        {
            Console.WriteLine($"item={item}; null? {item==null}");
        }
    }
}

Expected output:

item=A; null? False
item=B; null? False

Actual output:

item=A; null? False
item=; null? True

If you remove either the Select or the Take call, it's fine.

@clairernovotny
Copy link
Contributor

clairernovotny commented Nov 2, 2016

@jskeet can you confirm this is fixed in the 3.1-rc? It's not a specifically known issue otherwise.

EDIT: nightly feed info here

jskeet added a commit to jskeet/google-cloud-dotnet that referenced this issue Nov 2, 2016
I've updated the System.Interactive.Async version due to dotnet/reactive#290
I've raised googleapis/gax-dotnet#103 to cover that in GAX

I'm still seeing some issues with Insert - the rows don't immediately get listed always. But that's not to do with this change.
@jskeet
Copy link
Author

jskeet commented Nov 2, 2016

Yes, it works fine in 3.1.0-rc

@clairernovotny
Copy link
Contributor

Thanks, will close as fixed then.

jskeet added a commit to jskeet/google-cloud-dotnet that referenced this issue Nov 3, 2016
I've updated the System.Interactive.Async version due to dotnet/reactive#290
I've raised googleapis/gax-dotnet#103 to cover that in GAX

I'm still seeing some issues with Insert - the rows don't immediately get listed always. But that's not to do with this change.
jskeet added a commit to googleapis/google-cloud-dotnet that referenced this issue Nov 3, 2016
I've updated the System.Interactive.Async version due to dotnet/reactive#290
I've raised googleapis/gax-dotnet#103 to cover that in GAX

I'm still seeing some issues with Insert - the rows don't immediately get listed always. But that's not to do with this change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants