Add activity and revision limits by licitdev · Pull Request #27176 · directus/directus · GitHub
Skip to content

Add activity and revision limits#27176

Draft
licitdev wants to merge 1 commit intokey/usersfrom
key/activity-revisions
Draft

Add activity and revision limits#27176
licitdev wants to merge 1 commit intokey/usersfrom
key/activity-revisions

Conversation

@licitdev
Copy link
Copy Markdown
Member

Scope

What's changed:

  • Added entitlement-driven history filtering for directus_activity and directus_revisions, so reads are automatically constrained by activity_history_days and revisions_history_days.
  • Introduced a reusable history-query resolver that controllers and services use to merge license-derived date filters into incoming queries without replacing caller-provided filters.
  • Applied revision-history limiting through the related activity timestamp, so revision reads inherit the same date window via activity.timestamp.
  • Updated the activity feed UI to surface the current history window when a positive activity-history limit is present.
  • Updated revisions-related UI and license usage display so reviewers can see history entitlements directly from the licensing screen.
  • Added backend and frontend coverage around the new query filtering and messaging behavior.

Potential Risks / Drawbacks

  • The filter-merging logic sits in the read path for two system collections, so regressions could show up as missing history or unexpectedly empty result sets.
  • A zero-day entitlement now intentionally denies all results, which is a sharp behavior change and worth verifying against product expectations.
  • Time-window filtering depends on server time and inclusive _gte semantics, so off-by-one-day behavior near boundaries is something to watch.

Tested Scenarios

  • Added service tests for activity and revisions reads under different history-limit configurations.
  • Added frontend tests for the activity route notice and the revisions sidebar detail behavior.
  • Extended license-page coverage by surfacing the new history entitlements in the usage grid.

Review Notes / Questions

  • Special attention should be paid to whether every history-facing endpoint should use the same limiter semantics as readByQuery.
  • The new helper caches resolved queries per query object; that is intentional, but it is worth a quick sanity check for unexpected reuse patterns.
  • Reviewer eyes on the product copy for limited history would help, since it now appears in both activity and licensing contexts.

Checklist

  • Added or updated tests
  • Documentation PR created here or not required
  • OpenAPI package PR created here or not required

Fixes #<num>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant