Thank you, I posted to the issue tracker and I tested out the SQL. This is what I found:
The stored procedure getting the users GetOnlineUsers had a select like this:
SELECT * FROM UsersOnline UO
INNER JOIN vw_Users U ON UO.UserID = U.UserID
INNER JOIN UserPortals UP ON U.UserID = UP.UserId
WHERE UP.PortalID = @PortalID
Which looks fine, but what was happening was that the view was pulling the users’ instance in more than one portal. It was getting the user from portal 0 and 2, even though the passed in parameter for the portal id was 2. That was why duplicates appeared. I modifed it to be (notice the second condition added in the where clause):
SELECT * FROM UsersOnline UO
INNER JOIN vw_Users U ON UO.UserID = U.UserID
INNER JOIN UserPortals UP ON U.UserID = UP.UserId
WHERE UP.PortalID = @PortalID AND U.portalid = @PortalID
And now duplicates no longer appear.