Skip to content

Share one HTTP cache for live object cards #4374

Todo

Description

@sentry-junior

Annotation and Inbox cards now read their objects live (#4332), but caching works differently for each provider:

  • Core keeps a card cache in packages/junior/src/api/objects/resolve.ts. It has one entry per viewer and URL, with a 60s TTL (OBJECT_LINK_TTL_MS) and staleIfError. The Google, Notion, and Sentry link types use it, so each viewer's card refetches about once a minute.
  • GitHub opts out of it (cacheCards: false) and reads its own shared object cache in packages/junior-github/src/object-cache.ts. Pull requests live for 1h and issues for 60s, and webhooks keep them fresh. ETag-conditional responses are saved for 6h (packages/junior-github/src/conditional-requests.ts).
  • No card says how old it is. feat(annotations): Read each Annotation's object live for its viewer #4332 removed the "Last fetched …" line from the full object card, because the dashboard no longer shows saved facts.

Proposal from the review of #4332:

  • Move GitHub's conditional-request cache into core as one HTTP cache under plugin egress:
    • Key each entry by URL and credential scope.
    • Let each link type or plugin set its TTL.
    • Revalidate with If-None-Match/If-Modified-Since, and serve the stale entry on error.
    • GitHub moves onto this cache and keeps only its webhook-driven invalidation.
  • Have each card carry fetchedAt, the time its cache entry was stored. Show "Last fetched …" on the full card again when the card is older than its link type's TTL.

via @BYK.

--

View Session [Sentry]

Activity

  1. added a commit that references this issue on Nov 26, 2026
    8d9194c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions