feat(usage): on-demand period-scoped usage-data reset - #5831
Merged
Merged
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
diegosouzapw
force-pushed
the
feat/port-pr-2272-usage-reset
branch
from
July 3, 2026 05:12
35e9ab9 to
0d3eafd
Compare
Merged
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
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.
Thanks to @teddytkz for the original implementation.
Adds a Settings → Storage "Reset usage data" action that deletes usage-analytics rows older than a chosen period (5m, 1h, 3h, 6h, 12h, 1d, 7d, 30d) or wipes them entirely ("all"). Covers
usage_history,daily_usage_summary, andhourly_usage_summary, all in a single transaction, with a whitelisted period validated both in the DB layer and via Zod in the route.This PR is scoped to the usage-reset concern only. The connection bulk-delete part is intentionally not included — OmniRoute already has a native bulk-delete for provider connections.
Test plan
node --import tsx/esm --test tests/unit/usage-history-reset.test.ts— new regression test (fails without the implementation, passes with it)npm run typecheck:corenpx eslinton all changed filesnpm run check:docs-syncnpm run check:any-budget:t11