Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
db58b23d
Unverified
Commit
db58b23d
authored
2 months ago
by
Diego Sampaio
Committed by
GitHub
2 months ago
Browse files
Options
Downloads
Patches
Plain Diff
regression: do not update logged out sessions (#35041)
parent
23877256
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/meteor/app/statistics/server/lib/SAUMonitor.ts
+7
-1
7 additions, 1 deletion
apps/meteor/app/statistics/server/lib/SAUMonitor.ts
packages/models/src/models/Sessions.ts
+3
-1
3 additions, 1 deletion
packages/models/src/models/Sessions.ts
with
10 additions
and
2 deletions
apps/meteor/app/statistics/server/lib/SAUMonitor.ts
+
7
−
1
View file @
db58b23d
...
...
@@ -30,6 +30,8 @@ const getUserRoles = mem(
{
maxAge
:
5000
},
);
const
isProdEnv
=
process
.
env
.
NODE_ENV
===
'
production
'
;
/**
* Server Session Monitor for SAU(Simultaneously Active Users) based on Meteor server sessions
*/
...
...
@@ -143,7 +145,11 @@ export class SAUMonitorClass {
projection
:
{
loginToken
:
1
},
});
if
(
!
session
?.
loginToken
)
{
throw
new
Error
(
'
Session not found
'
);
if
(
!
isProdEnv
)
{
throw
new
Error
(
'
Session not found during logout
'
);
}
logger
.
error
(
'
Session not found during logout
'
,
{
userId
,
sessionId
});
return
;
}
await
Sessions
.
logoutBySessionIdAndUserId
({
loginToken
:
session
.
loginToken
,
userId
});
...
...
This diff is collapsed.
Click to expand it.
packages/models/src/models/Sessions.ts
+
3
−
1
View file @
db58b23d
...
...
@@ -1442,8 +1442,10 @@ export class SessionsRaw extends BaseRaw<ISession> implements ISessionsModel {
const
now
=
new
Date
();
const
query
=
{
instanceId
,
sessionId
,
year
,
month
,
day
,
logoutAt
:
{
$exists
:
false
}
};
return
this
.
updateOne
(
{
instanceId
,
sessionId
,
year
,
month
,
day
}
,
query
,
{
$set
:
data
,
$setOnInsert
:
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment