-
-
Notifications
You must be signed in to change notification settings - Fork 34
sync --include-comments downloads comments again for every open thread, even when the thread has not changed #198
Copy link
Copy link
Closed
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Activity
Metadata
Metadata
Assignees
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary
I keep a local archive of pgjdbc/pgjdbc (489 open issues and pull requests) and want to refresh it every week or month. Each
gitcrawl sync owner/repo --include-commentsrun downloads the comments of every open thread again, including threads whoseupdated_athas not changed since the previous run. With--with pr-detailsthe same happens to files, commits, checks, and review threads of every open pull request. A periodic refresh therefore costs about as many API requests as the first backfill.Reproduction
gitcrawl 0.9.6, a fresh database, two runs back to back:
Progress file after the second run:
{"schema":"gitcrawl.sync-progress.v1","repository":"openclaw/gitcrawl","state":"succeeded","stage":"finalizing","issues_received":0,"pull_requests_received":1,"comments_received":2,"observed_at":"2026-09-13T15:03:25.977678Z"}The one open thread is #197. Its
updated_atdid not change between the runs, and the database already held its comments at thatupdated_atbefore the second run started:On this repository the second run fetches 2 comments. On a repository with a few hundred open threads, it fetches the comments of all of them. I have not measured the request count on pgjdbc/pgjdbc itself.
Expected
When a thread's
updated_atin the list response equals thesource_updated_atrecorded for a child family inthread_child_observation_reservations, sync does not request that family for the thread. In the reproduction above, the second run reports"comments_received": 0.A way to force a full re-download (for example, a flag) stays available for data that can change without moving
updated_at.Actual
Syncer.Syncrequests comments, review threads, and pull request details for every row in the list response (internal/syncer/syncer.go, the loop overrowsbeforepersist). The comparison withthread_child_observation_reservationshappens only afterwards, inReserveThreadChildObservation, when the data is written. Unchanged data is discarded after it has been downloaded.Possible approach
This part is a suggestion; the report above stands without it.
ThreadChildObservationfor each thread and family, and skip the request whensource_updated_atequals the row'supdated_at.updated_at; I have not verified this.sincetaken from a watermark, as the closed sweep already does withclosed_sweep_through. After fix: avoid stalled embedding batches and stale open threads #175, threads missing from a response are not treated as closed or deleted.Workaround
--state all --since <date of the previous sync>limits the list to threads updated after that date, so only those are hydrated. The caller has to track the date, and a run with--sincedoes not advanceclosed_sweep_through.Related
I found no existing issue or pull request about this (searched open and closed items for
since,incremental,watermark, andcomments hydration). #175 fixed missed closures after an offline period, but it does not change which threads are hydrated.