re-frame

https://github.com/Day8/re-frame/blob/master/docs/README.md https://github.com/Day8/re-frame/blob/master/docs/External-Resources.md
kennytilton 2020-09-03T00:49:16.015800Z

Relative noob here: I am seeing a class of bug in which it turns out app-db holds stale state from an earlier context. In one extreme case one user logged out and another logged in (same person, QA testing jumping between users) and the second "user" ran into old state in app-db . Is this a Known Thing(tm)? If so, does it mean we are missing some clean-up idiom? Some initialization idiom? Mistakenly using app-db to pass state between events? Other______? Thx!

p-himik 2020-09-03T08:13:10.016100Z

It's a known thing because app-db is an atom that doesn't clear its values by itself. If you want new state, you have to set it yourself, that's it. I can't say anything more specific without seeing an example.

p-himik 2020-09-03T08:15:38.016300Z

Also, regarding user authentication - now I just treat that part of the app and not being a part of the SPA. I.e. if a user clicks on the "Log In" button after filling the login information, the page is refreshed. There are two main advantages to this approach: - You guarantee that the state is fully reset - there's just no place for a mistake here - You make the website much friendlier for web password managers that monitor form submissions

kennytilton 2020-09-03T12:15:58.016600Z

Awesome. Thx! I am sure we can find a "kickoff" event where app state can be reset.