Skip to content

feat: watch improvements#310

Open
jason-lynch wants to merge 1 commit intofeat/put-with-updated-versionfrom
feat/watch-improvements
Open

feat: watch improvements#310
jason-lynch wants to merge 1 commit intofeat/put-with-updated-versionfrom
feat/watch-improvements

Conversation

@jason-lynch
Copy link
Member

Summary

Makes several substantial improvements to the storage.Watch operations:

  • Watch now does a synchronous Get operation before starting the watch to get the current value(s) and to get the start revision for the watch. Callers no longer have to do this operation themselves.
  • Watch now restarts itself automatically using the most recently-fetched revision. We were previously repeating this restart logic in every caller. Restarts are rate-limited to 1 per second.
  • Watch reports errors over an error channel, matching the convention that we've established everywhere.

We had an unused Until operation, so I opted to remove it rather than update it to reflect these changes.

Testing

From the user's perspective, everything should function the same as it did before. The changes in this PR were more focused on improving the watch's usability and edge-case behavior, such as when a Put occurs between the initial Get and the Watch operations, or the recovery behavior after an outage.

@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3b683f8a-ff84-4003-b174-d2f4a4438832

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/watch-improvements

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@jason-lynch jason-lynch force-pushed the feat/watch-improvements branch 2 times, most recently from f3edc39 to 0905973 Compare March 20, 2026 21:40
@jason-lynch
Copy link
Member Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Mar 23, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Makes several substantial improvements to the `storage.Watch`
operations:

- `Watch` now does a synchronous `Get` operation before the starting the
  watch to get the current value(s) and to get the start revision for
  the watch. Callers no longer have to do this operation themselves.
- `Watch` now restarts itself automatically using the most recently-
  fetched revision. We were previously repeating this restart logic in
  every caller. Restarts are rate-limited to 1 per second.
- `Watch` reports errors over an error channel, matching the convention
  that we've established everywhere.

We had an unused `Until` operation and I opted to remove it rather than
update it for these changes.
@jason-lynch jason-lynch force-pushed the feat/put-with-updated-version branch from fa785be to 64a9954 Compare March 24, 2026 00:16
@jason-lynch jason-lynch force-pushed the feat/watch-improvements branch from 0905973 to fa49e10 Compare March 24, 2026 00:16
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