- 
                Notifications
    You must be signed in to change notification settings 
- Fork 65
fix: get actual number of active users #814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
35375f1    to
    e6a79aa      
    Compare
  
    | /backport to stable31 | 
| /backport to stable30 | 
| Thank you 🙏 I will review and test asap. @tcitworld what do you think? | 
| I'll check the failing oracle test tomorrow | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funny enough, I've come to the same realization on the very same day this PR comes out.
Worst thing is probably people using WebDAV sessions which are deleted from oc_authtoken after one day.
| ->where($queryBuilder->expr()->eq('appid', $queryBuilder->createNamedParameter('login'))) | ||
| ->andWhere($queryBuilder->expr()->eq('configkey', $queryBuilder->createNamedParameter('lastLogin'))) | ||
| ->andwhere($queryBuilder->expr()->gte( | ||
| $queryBuilder->expr()->castColumn('configvalue', IQueryBuilder::PARAM_INT), | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OCI tests are failing because configvalue is a string and the other argument an integer.
My commit to cast configvalue to an int made Postgres and OCI unhappy 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$queryBuilder->expr()->gte(
				'configvalue',
				$queryBuilder->createNamedParameter((string)$this->timeFactory->getTime() - $offset),
				IQueryBuilder::PARAM_STR,
			)
Treating both as string seems to work, but isn't that weird?
3a52433    to
    505c843      
    Compare
  
    Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
Fix #809
The existing logic checks the
authtokentable which comes with the tradeoff that user's row is deleted on logout.