fix: Remove userGroup field from usage tracking (fixes #673)#857
Open
nikhase wants to merge 6 commits into
Open
fix: Remove userGroup field from usage tracking (fixes #673)#857nikhase wants to merge 6 commits into
nikhase wants to merge 6 commits into
Conversation
Since users can have multiple groups, it's unclear which group usage should be attributed to. This change removes the userGroup field from the usages table. Changes: - Add migration to drop userGroup column from usages table - Remove userGroup field from UsageEntity - Remove userGroup from usage tracking calls - Remove group-level quota check from CheckUsageMiddleware - Update tests to not set userGroup field The change maintains user-level quota enforcement while removing ambiguous group-level tracking.
0f087c1 to
26b4eef
Compare
surt91
reviewed
Jan 5, 2026
Comment on lines
+55
to
+56
| // Note: Group-level quota check removed because userGroup field was removed from usage tracking (issue #673) | ||
| // Only user-level quotas are enforced now |
Collaborator
There was a problem hiding this comment.
I would remove this comment, since it does not document existing code (but removed code).
surt91
requested changes
Jan 5, 2026
Collaborator
There was a problem hiding this comment.
This PR removes the usage data by group, which is good.
But this PR also needs to remove the monthlyTokens from the UserGroupRepository as well as all UI elements, where this property can be set. Otherwise c4 would offer a UI to set the maximum number of tokens per group but would not enforce it.
Since group-level usage tracking was removed in the previous commit, the monthlyTokens field (group-level quota) can no longer be enforced. This commit removes the field entirely to prevent user confusion. Changes: - Remove monthlyTokens from UserGroupEntity - Add migration to drop monthlyTokens column from database - Remove monthlyTokens from backend DTOs and interfaces - Remove monthlyTokens input fields from frontend dialogs - Remove comment referencing removed functionality - Keep monthlyUserTokens (per-user quota) which is still enforced Only user-level quotas (monthlyUserTokens) are now supported.
Removed monthlyTokens field references from create and update user group use-cases to complete the removal of group-level quota tracking. This fixes TypeScript compilation errors where UpsertUserGroupDto no longer contains monthlyTokens but the use-cases still expected it. Changes: - Updated Values type to only include monthlyUserTokens and name - Removed monthlyTokens from destructuring and entity assignment - Updated package-lock.json from dependency install
Removed all references to the monthlyTokens field from user group dialog tests to match the removal of group-level quota tracking. Changes: - Removed monthlyTokens from mockUserGroup in UpdateUserGroupDialog tests - Removed monthlyTokens field assertions from tests - Removed entire test for "monthly tokens goes below zero" - Cleaned up remaining test to only validate monthlyUserTokens
Removed monthlyTokens field from user group e2e test assertions and test data to match the removal of group-level quota tracking. Changes: - Removed monthlyTokens from newUserGroup test data - Removed monthlyTokens from updatedUserGroup test data - Removed monthlyTokens assertions from create/update test cases
Updated the generated OpenAPI specification to reflect the removal of the monthlyTokens field from UserGroup DTOs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since users can have multiple groups, it's unclear which group usage should be attributed to. This change removes the userGroup field from the usages table.
Changes:
The change maintains user-level quota enforcement while removing ambiguous group-level tracking.