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

Fix compatibility with Sanic 20.3.0 #4

Closed
brechtm opened this issue Jun 16, 2020 · 5 comments
Closed

Fix compatibility with Sanic 20.3.0 #4

brechtm opened this issue Jun 16, 2020 · 5 comments

Comments

@brechtm
Copy link

brechtm commented Jun 16, 2020

This change breaks Sanic-CookieSession: sanic-org/sanic#1801

@brechtm brechtm changed the title Fix compatibility with Sanic 0 Fix compatibility with Sanic 20.3.0 Jun 16, 2020
@danielalvsaaker
Copy link

I was about to open a proper pull request, but realized midway that it's not worth it considering the repository is not maintained. I would suggest migrating to sanic_session using the in-memory session interface.

@pyx
Copy link
Owner

pyx commented Dec 14, 2020

Sorry about the hiatus.
@danielalvsaaker is you are still interested in using this, could you please reopen the pull request, I will make a new release based on that. Either way, thank you.

@brechtm
Copy link
Author

brechtm commented Dec 22, 2020

Sorry about the hiatus.

No need to apologize! But a new release with this fix would be highly appreciated.

@danielalvsaaker is you are still interested in using this, could you please reopen the pull request, I will make a new release based on that. Either way, thank you.

As the owner of this project, you should be able to reopen the PR yourself.

@pyx
Copy link
Owner

pyx commented Dec 25, 2020

@brechtm because PR #5 is broken: hard-coded session object name and inconsistency of object property vs dict element, and the new context type, types.SimpleNamespace does not have dict-like interface, etc. so I actually wrote a fix myself, including updated documentation, code example, and tests.

Then I found out the test client switch from requests to httpx, and that breaks the tests, e,g req, resp = app.test_client.get('/inc', cookies=cookies) does not keep the cookies in the object resp, half of the time (heisenbug😂), so I cannot simulate a series of post with states, httpx support context manager style code blocks (with statement) and it should work, except sanic 's test client does not support this nor expose the underlying httpx object.
Before I shoehorn an httpx object into tests, I need some reading about the difference between requests and httpx to find out why it doesn't work, I read the code in sanic briefly and it seems okay, passing the cookies object to httpx, I am feeling like debugging sanic and httpx at the same time...
I might rewrite the whole test-suit.

@pyx
Copy link
Owner

pyx commented Oct 6, 2023

Now that I pushed the fix into master, close this one.

@pyx pyx closed this as completed Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants