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

Null response and the cookie collection is not working properly #537

Closed
ghost opened this issue Jul 25, 2020 · 7 comments
Closed

Null response and the cookie collection is not working properly #537

ghost opened this issue Jul 25, 2020 · 7 comments
Labels

Comments

@ghost
Copy link

ghost commented Jul 25, 2020

As mentioned in the issue #534 sometimes some requests don't get a response => null
From there I realized that a NullReferenceException error when reading cookie from response
image

Flurl.Http.FlurlHttpException: Call failed. Collection was modified; enumeration operation may not execute.
image

@ghost ghost added the bug label Jul 25, 2020
@tmenier
Copy link
Owner

tmenier commented Jul 26, 2020

The first error does sound a legitimate bug. Although I'm considering Flurl 2.x to be in maintenance mode, I might consider fixing that one.

The second is a known issue with concurrency that I don't plan on fixing. If you're doing concurrent "cookie sessions" in 2.x, my recommendation is to use a FlurlClient per session rather than a global singleton.

Having said all that, I would strongly recommend following #506, a complete revamp of cookies that will be released very soon in the next 3.0 prerelease. It solves these issues and much more, and I really encourage anyone using cookies with Flurl to offer feedback.

@ghost
Copy link
Author

ghost commented Jul 26, 2020

The error I encountered was reported when using Flurl version 3.0 previous 3.
I registered the IFlurClientFactory service as Singleton with implementation PerBaseUrlFlurlClientFactory and EnableCookies = true

@tmenier
Copy link
Owner

tmenier commented Jul 26, 2020

None of the new cookie bits in in any of the existing prereleases yet.

@tmenier
Copy link
Owner

tmenier commented Aug 8, 2020

#506 is now released in prerelease 4. Please test and let me know if this issue is resolved.

https://www.nuget.org/packages/Flurl.Http/3.0.0-pre4

@ghost
Copy link
Author

ghost commented Aug 8, 2020

Well, thank you very much. I will test soon the problem that had previously encountered

@tmenier
Copy link
Owner

tmenier commented Aug 8, 2020

Sure thing. If you confirm it's resolved, are you ok with closing this and #520? I'd just like to clean up my list of open issues a bit by closing anything cookie-related that's a "won't fix" in 2.x and in no longer relevant in 3.0.

@tmenier
Copy link
Owner

tmenier commented Sep 1, 2020

Feel free to re-open if the latest prerelease doesn't resolve this.

@tmenier tmenier closed this as completed Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant