U4-1983 - Member cache is not utilized properly, "number of users online" won't work and won't work in load balanced environments

Created by Shannon Deminick 21 Mar 2013, 21:46:56 Updated by Shannon Deminick 07 Jan 2014, 12:56:32

Subtask of: U4-1659

It would seem that the membership provider returns 'number of users online' based on how many members are in cache... this will never work in load balanced environments but there's much more to this story - the number of online users should DEFINITELY not be based on the number of members in cache for a few reasons: Cache turnover can cause the cache to be invalidated at any time. If a member updates their profile or if an admin updates a member's profile whilst the member is logged in, the cache will be removed until an API call is made to re-load it into cache.

To get the number of users online we would have to use a database query.

Currently member cache is cleared when members are updated, deleted or when a member logs out. It should simply be based on updated or deleted. If a member logs out there's no immediate reason to clear from cache and we cannot ensure this will be cleared on load balanced environments either because there are no events to FormsAuthentication.Signout.

Member cache is currently created when a member is logged in via the base services or if a developer decides to call the magic method: AddMemberToCache manually... otherwise the member is never cached and the 'number of users online' is also invalid.

Member cache should automatically be added whenever a call is made to the membership provider: ValidateUser which calls our business logic api: Member.GetMemberFromLoginAndEncodedPassword. If a member is found, then add it to the cache... simple... and this will also work in load balanced environments. Then we can remove the need to be manually ensuring that member cache exists by having to call AddMemberToCache, and the only reason this would ever be necessary would be to make the number of users online work, but as mentioned before it will still never work as expected.

Comments

Priority: Normal

Type: Bug

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 4.8.0, 4.9.0, 4.10.0, 4.11.0, 6.0.0, 4.9.1, 4.11.1, 4.11.2, 4.11.3, 4.11.4, 6.0.1, 4.11.5, 6.0.2

Due in version: 6.2.0

Sprint:

Story Points:

Cycle: