Skip to content

Issue snapshot refresh re-reads the tracker on every visit after 5 minutes #2

Open

Description

@xgooz3x

ThreadIssueService.syncLink returns without dispatching when the tracker's fresh snapshot matches the stored one. So snapshot.syncedAt never advances for an unchanged issue. Five minutes after the last real change, isStale is permanently true for that link, and every thread.visited (and every refresh({ staleOnly: true })) calls issues.detail again for each unchanged linked issue.

That costs one tracker read per linked issue per thread visit, which uses up tracker rate limits (Linear limits by query complexity).

Fix direction: record the last check time in memory per thread and link, and use it in the stale check. Clear the entry on unlink, or cap how many entries it keeps. Don't dispatch no-op syncs, because thread.issue-synced also triggers the awareness relay and the settlement sweep.

Blocker: apps/server/src/orchestration-v2/ThreadIssueService.ts has no test harness yet, and the fix needs a test that drains the worker and counts issues.detail calls across visits.

Raised by CodeRabbit on #1.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions