Skip to content

[bug] GET /repos/:owner/:repo/installation returns stale installed=false for 60s after install webhook #208

Description

@luciferlive112116

Description

GET /api/v1/repos/:owner/:repo/installation (added in #203 for the registration UI install gate) is subject to the global CustomCacheInterceptor 60s production cache. When the GitHub App is installed and the installation / installation_repositories webhook sets repos.installation_id, repeated GETs with the same URL can still return installed: false until the cache entry expires.

GET /api/v1/health and GET /api/v1/pulls/:owner/:repo/:number/files already opt out via @NoCache(); the install-status endpoint does not.

Steps to Reproduce

  1. Run the service with NODE_ENV=production and Redis configured.
  2. Register a repo row without installation_id (or use a repo not yet installed).
  3. Call GET /api/v1/repos/{owner}/{repo}/installation and note installed: false.
  4. Install the Gittensor Mirror App on that repo so the webhook upserts installation_id.
  5. Within 60 seconds, repeat the same GET with identical path/query.
  6. Observe the cached pre-install payload (installed: false) is returned.

Expected Behavior

After the install webhook updates repos.installation_id, the install-status endpoint should reflect installed: true on the next read.

Actual Behavior

Cached GET responses can remain installed: false for up to 60 seconds after the webhook mutates the row.

Environment

  • OS: Linux
  • Runtime/Node version: Node 20

Additional Context

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions