2.0 maintenance

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 anni tempo fa
hey there

maintenance in 2.0 is not working not is scheduled tasks
guests are not being deleted
i have now 3000 active guests
if i go to maintenance and select with or without shopping cart and define special date it will tell me "0 guests deleted"
12 anni tempo fa
Hmm... Could you try to debug the application in order to know why they're not deleted? Look at CustomerService.DeleteGuestCustomers method (there's try-catch block)
12 anni tempo fa
I think I found a problem in the default implementation of Nop.Core.IWorkContext (Nop.Services.WorkContext): the customer cookie is always set, even when the customer is authenticated. Moreover, when no user is authenticated, the customer cookie is read and if the corresponding is registered, a new guest customer is created. So imagine the following sequence:

1. A customer is logged in and therefore the customer cookie has its guid;
2. The customer logs out: the WorkContext tries to create a guest from the guid but since it corresponds to a registered user, a new guest is created;
3. The customer logs in again: the customer cookie now contains the guid of the registered customer account;

If you repeat steps 2 and 3, a new guest user will be created each time. I think that can be avoided by only storing guests account guids in the customer cookie.

Is that a desired behavior? Since the primary key is an int, a (very) successful store could run out of ids (and forced to switch to bigint) earlier than necessary.
12 anni tempo fa
asoares wrote:
Is that a desired behavior?

That's OK considering that guest customer records are periodically deleted (manually in admin area or automatically by a scheduled task). but thanks for suggestion. I'll create a proposed work item for this task.
12 anni tempo fa
IDs taken by guest account are never used again, except if someone turn off identity and use a stored proc to find the next available ID (recovering gaps in IDs after some guest accounts have been deleted). But again, there are a whole lot of IDs that can be used, even with an int, before we run out. I tend to be a little picky about that I think :)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.