Skip to content

fix: prevent clip watch from skipping images - #24

Merged
Luqueee merged 1 commit into
mainfrom
codex/fix-clip-watch-watermark
Sep 4, 2026
Merged

Luqueee merged 1 commit into
mainfrom
codex/fix-clip-watch-watermark

Conversation

@Luqueee

@Luqueee Luqueee commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #12.

Client.Watch now advances its watermark from the Last-Modified value returned by the exact GET that was processed. It no longer performs a follow-up HEAD that can observe a later publication and skip it.

Validation

  • go test ./...
  • go test -race ./...
  • go vet ./...
  • git diff --check

Added a deterministic regression test that publishes a second image while the first GET is still in progress and verifies both images are observed.

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 29737457-6729-4d1d-9315-0c09c9386802

📥 Commits

Reviewing files that changed from the base of the PR and between 03db9ab and e42d6f1.

📒 Files selected for processing (2)
  • internal/clip/client.go
  • internal/clip/client_test.go

Included review availability: Your plan provides up to 8 included reviews per hour; 0 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes

    • Improved image watching to reliably detect newly published images without skipping updates during concurrent publishing.
    • Uses timestamps from image retrieval responses to maintain accurate update tracking.
  • Tests

    • Added coverage for concurrent image publishing to verify that all available images are delivered.

Walkthrough

Changes

Watch watermark race fix

Layer / File(s) Summary
Return the GET timestamp
internal/clip/client.go
The internal pull operation now returns the downloaded path and parsed GET Last-Modified timestamp. Error paths return a zero timestamp.
Update Watch watermark from the pull
internal/clip/client.go, internal/clip/client_test.go
Watch uses the GET timestamp, with a HEAD fallback when needed. A synchronized regression test verifies that images published during a pull are both delivered.

Merge Risk: ⚪ Minimal · up to e42d6

Watch now retains the processed image timestamp, preventing a concurrently published image from being skipped; the regression test covers this sequence. No current merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title uses the required Conventional Commit format and clearly describes the fix to prevent image skips in clip Watch.
Description check ✅ Passed The description explains the watermark fix, the regression scenario, the added test, and the validation commands. It is directly related to the changeset.
Linked Issues check ✅ Passed The changes satisfy issue #12. Watch uses the Last-Modified value from the processed GET, retains fallback behavior for missing or invalid headers, and adds a deterministic regression test.
Out of Scope Changes check ✅ Passed The changes are limited to the Watch watermark fix and its regression test. No unrelated code changes are identified.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-clip-watch-watermark

Comment @coderabbitai help to get the list of available commands.

@Luqueee
Luqueee merged commit bd661cf into main Sep 4, 2026
4 checks passed
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.

Prevent clip Watch from skipping images published during Pull

1 participant