Skip to content
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

Count active browser sessions per user #8736

Merged
merged 10 commits into from
Nov 13, 2024
Merged

Count active browser sessions per user #8736

merged 10 commits into from
Nov 13, 2024

Conversation

Tymek
Copy link
Member

@Tymek Tymek commented Nov 13, 2024

About the changes

Show info on how many devices a user is logged in to an admin.

Copy link

vercel bot commented Nov 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend 🛑 Canceled (Inspect) Nov 13, 2024 3:49pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Nov 13, 2024 3:49pm

Copy link
Contributor

github-actions bot commented Nov 13, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

@@ -12,4 +12,5 @@ export interface ISessionStore extends Store<ISession, string> {
getSessionsForUser(userId: number): Promise<ISession[]>;
deleteSessionsForUser(userId: number): Promise<void>;
insertSession(data: Omit<ISession, 'createdAt'>): Promise<ISession>;
getUserSessionsCount(): Promise<{ userId: number; count: number }[]>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe getSessionCount to be consistent with insertSessions? We have ForUser in the name only when there's a param userId

Copy link
Member Author

@Tymek Tymek Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getSessionsCount is OK

@@ -283,6 +284,10 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_FLAG_OVERVIEW_REDESIGN,
false,
),
showUserDeviceCount: parseEnvVarBoolean(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to be inconsistent. We have user session count not device count in the code

Copy link
Contributor

@kwasniew kwasniew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments inside

@Tymek Tymek changed the title Count user active sessions Count active browser sessions per user Nov 13, 2024
@Tymek Tymek enabled auto-merge (squash) November 13, 2024 15:45
@Tymek Tymek merged commit 60fb647 into main Nov 13, 2024
7 of 11 checks passed
@Tymek Tymek deleted the 1-3098 branch November 13, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants