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

can't empty session storage list #683

Closed
rbckman opened this issue Oct 20, 2020 · 10 comments · Fixed by #684
Closed

can't empty session storage list #683

rbckman opened this issue Oct 20, 2020 · 10 comments · Fixed by #684

Comments

@rbckman
Copy link

rbckman commented Oct 20, 2020

This has been working flawlessly in the past version but since I upgraded to new version 0.61 I can't set a session storage value to None or 0 once it has had another value other than that.

Pretty bad since I use it to store shopping cart items, now I need to kill session if I want to empty the cart.

@iredmail
Copy link
Contributor

I will try to check source code and figure it out, but if you can help find it, that would be better for me. :)

@iredmail
Copy link
Contributor

Do you have some code to help us reproduce the issue? It will help a lot otherwise I have to check source code “blindly”.

@rbckman
Copy link
Author

rbckman commented Oct 20, 2020 via email

@rbckman
Copy link
Author

rbckman commented Oct 20, 2020

ok, so haven't had time to go check source code but wrote a minimalistic code to reproduce this bug, https://dev.tarina.org/

will have time to go into web.py source tomorrow.

@iredmail
Copy link
Contributor

iredmail commented Oct 21, 2020

I can not reproduce the issue with your sample code. Tested on FreeBSD 12.1-p10, Python 3.8.6, web.py-0.61 (stable release, not the git clone edition).

  • Each time i clicked the Foo link, it added a new Foo at the bottom. Same to the Bar link.
  • Then i removed /?additem=foo in URL. You have session and cookie, so the info preserved.

@rbckman
Copy link
Author

rbckman commented Oct 21, 2020

ok, I havent been clear enough. Updated the repo to be much clearer. Here's a live version https://dev.tarina.org/

So, everything is fine except the last item you remove, it won't get removed. It seems like it is removed for as long as you dont reload the page, but once u reload, the last item pops back in the cart. spooky stuff..

@rbckman
Copy link
Author

rbckman commented Oct 21, 2020

Same thing occurs on 3 different Debian boxes with latest stable and python 3.7.3. Running apache2 and web.py-0.61

Reverted back to web.py==0.40.dev1 and it works like a charm so I'm pretty sure this is a bug.

@rbckman rbckman changed the title cant set session storage object value to none or 0 can't empty session storage list Oct 21, 2020
@iredmail
Copy link
Contributor

Fixed in PR #684, could you please help test it?

@rbckman
Copy link
Author

rbckman commented Oct 21, 2020

YES! ! it works!!! thank you so much! was actually looking at those lines in the source so maybe I one day can contribute with actually writing code.. for now I'll just keep on using web.py to build sites and report bugs if I find any.

@iredmail
Copy link
Contributor

Great. it's now waiting for reviewers to approve the PR.

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

Successfully merging a pull request may close this issue.

2 participants