Skip to content

Feedback summary cache misses every hour for relative date ranges #131185

Description

@PavleProd

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

Found by reading the source at 7d94848 and by running the endpoint's get() with the database, the cache and the Seer call stubbed; not seen in a live sentry.io session.

  1. Open User Feedback with a relative date filter, such as the default "Last 14 days". useFeedbackSummary sends statsPeriod=14d to /organizations/{org}/feedback-summary/.
  2. get_date_range_from_stats_period returns start = now - 14d and end = now.
  3. The summary cache key formats start and end at hour granularity.
  4. Open the page again an hour later.

Expected Result

The second request uses the cached summary. SUMMARY_CACHE_TIMEOUT is one day, and the categories endpoint already switches its key to day granularity for ranges of 2 days or more.

Actual Result

The key changes every hour, so the first request in each new hour is a cache miss. Each miss sends up to 1,000 feedbacks or 1,000,000 characters to Seer's summarize endpoint. The one-day TTL is not used after the first hour.

One request per hour for 24 hours, same organization and projects (OrganizationFeedbackSummaryEndpoint.get() at 7d94848; Group query, get_projects, cache and get_summary_from_seer stubbed; clock moved with time_machine):

statsPeriod Seer summary calls, master With the categories key logic
14d (page default) 24 1
7d (endpoint default) 24 1
24h 24 24 (hour key kept)

The hour key came from the review of #93461, so that a short range such as the last hour gets its own summary. A fix that copies the categories logic (hour key below 2 days, day key from 2 days up) keeps that and is ready as a PR. The trade-off is the one the categories endpoint already makes: for ranges of 2 days or more, a summary can be up to a day old.

Product Area

User Feedback

Activity

  1. getsantry commented on Nov 15, 2026

    @getsantry
    Contributor

    Assigning to @getsentry/support for routing ⏲️

  2. linear-code commented on Nov 15, 2026

    @linear-code
  3. moved this to Waiting for: Support in GitHub Issues with 👀 3on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions