Closed aaronjudd closed 9 years ago
@mikemurray I'm looking into using anonymous user accounts, rather than maintaining the "sessions" logic. I don't remember my logic for not doing this from the get go, but I assume I felt it would be both a maintenance and performance issue. (ie: creating a lot churn on the users collection). The upside is that we'd only every have to deal with the users collection, and can refactor easily broken and complex bits that've been bothersome for a while - (caused mainly I think in an attempt to avoid this approach). This will complete remove sessions from cart handling.
This means every user would start as logged in to a unique anonymous account, unless they have already logged in as regular user. This would change the accounts UI flow in #348 reaction-accounts.
Here's how I'm thinking the accounts workflow could work.
Account
and Cart
on mergeCart
from ( 1 ) is extended into ( 3 )' Cart
Account
from ( 1 ) is extended into ( 3 )'s Account
@queso appreciate your thoughts on this as well...
I think this is linked to this issue but when you log in the system with a user and then create an order then log out the completed page is still there with multiple orders, some of which weren't made with the user who was last logged in (but they shouldn't be shown if noone is logged in) The list of the orders on the completed page are selected by sessionId I think, and not by user because the list contains orders which were not made by the current user.
Hi. As far as I understand, current logic of sessions flow may be illustrated by this diagram:
So, as you could see, we got a problem here. I've just started to think how to fix that... Maybe someone has ideas on this case?
Hello, here what we have:
We can try to cut out all ReactionCore.sessionId
global use cases, by passing real sessionId
to this methods. And maybe remove the session
collection completely as next step.
As you can see, there is a one place - ReactionCore.MethodHooks.after("cart/submitPayment")
- where we can't pass browser's sessionId
directly. But we can do it from @aaronjudd, I will be waiting for your decision here.cart/submitPayment
, so maybe we don't need this hook at all? Could we, for example, add this functionality to some new method, witch will be called after cart/submitPayment
? Or maybe we could add this snippet to the end of cart/submitPayment
?
UPD (02.01): problem with hook solved.
Current Session behaviour:
the problem is.. what should the logic be when the same session exists. Creating a new session after an order is placed should resolve this (but may have some complications)