-
Notifications
You must be signed in to change notification settings - Fork 2k
Fix user count #4677
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
Fix user count #4677
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
PR Summary
This PR modifies how user counts are calculated for billing purposes by switching to get_live_users_count
, which provides a more accurate count by excluding API keys, external connector users, and invited users.
backend/onyx/db/auth.py
: Introducesget_live_users_count
function that filters out API keys and external permission users for accurate billingbackend/onyx/server/manage/users.py
: Updates bulk invite and remove user endpoints to useget_live_users_count
for tenant billing updates- Potential edge case: Ensure billing system properly handles transition from old counting method to new one to avoid billing discrepancies
- Consider adding a migration plan to handle existing tenants' billing cycles
2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile
* Fix user count * Add helper + fix async function as well * fix mypy * Address RK comment
* Fix user count * Add helper + fix async function as well * fix mypy * Address RK comment
* Fix user count * Add helper + fix async function as well * fix mypy * Address RK comment
Description
Fixes https://linear.app/danswer/issue/DAN-1953/fix-user-count-for-billing
How Has This Been Tested?
👀
Backporting (check the box to trigger backport action)
Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.