Skip to content

feat(sessions): cache the pull request in sessions.db - #1851

Merged
igorjs merged 1 commit into
mainfrom
feat/issue-536-s6b-pr-cache
Nov 15, 2026
Merged

igorjs merged 1 commit into
mainfrom
feat/issue-536-s6b-pr-cache

Conversation

@igorjs

@igorjs igorjs commented Nov 15, 2026

Copy link
Copy Markdown
Member

Summary

S6b of #536 (first part of WU-7): gather takes the PR lookup, the write-back, now and a force flag as parameters. A stored PR checked under 300 seconds ago on the same branch skips gh. Otherwise the lookup runs and one UPDATE stores the PR, headRefOid and baseRefName in an existing sessions.db (never created). A lookup that finds nothing keeps the stored PR and stamps pr_checked_at. A write failure is ignored.

Notes for reviewers

  • The null-cwd place backfill (scenarios s10 to s12) is the next PR (S6c), to keep each PR near 500 lines. This diff is about 540 lines because of review-driven tests.
  • Review found a real bug, fixed here: a cached PR was shown for another branch after a mid-session branch switch, and on trunk or gone-place rows. The cache now applies only on the same branch.
  • 5 lens reviews; also fixed the module doc, shared store helpers and four weak test spots.

Refs #536

gather skips the gh lookup when the stored PR was checked under five minutes
ago and the branch is unchanged. Otherwise it looks the PR up and writes it
back to an existing database with one UPDATE. A lookup that finds nothing
keeps the stored PR and stamps the check time. A forced lookup ignores the
cache for the apply command that comes later.

Refs #536

Signed-off-by: igorjs <2278164+igorjs@users.noreply.github.com>
@igorjs
igorjs enabled auto-merge November 15, 2026 08:48
@igorjs
igorjs added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit d5d6258 Nov 15, 2026
30 checks passed
@igorjs
igorjs deleted the feat/issue-536-s6b-pr-cache branch November 15, 2026 08:55
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