Skip to content

fix(events): publish the refs a folded checkpoint skipped - #51

Merged
yordis merged 3 commits into
mainfrom
yordis/fix-events-folded-checkpoint-refs
Oct 29, 2026
Merged

yordis merged 3 commits into
mainfrom
yordis/fix-events-folded-checkpoint-refs

Conversation

@yordis

@yordis yordis commented Oct 29, 2026

Copy link
Copy Markdown
Member
  • A checkpoint that folded log entries before the events bridge read them made the bridge skip the gap, so webhook consumers never saw those pushes.
  • The JetStream sink still skips such gaps; its cursor is the stream, so repairing it needs a ref baseline and is left for a separate change.
  • Brings in events: publish the refs a folded checkpoint skipped tobi/walgit#109 by redhox, cherry-picked with original authorship; the upstream test fails on our main and passes with this change.

Coulm and others added 2 commits October 28, 2026 23:00
A checkpoint can fold log entries the events bridge has not read yet, so
consumers lost the push. Store the refs visible at the published seq in the
cursor and diff them against the current refs on a gap.

(cherry picked from commit 4046b96 and
ff6714f, tobi#109; adapted to the
walgit-events crate)

(cherry picked from commit 4046b96 and ff6714f (tobi#109), adapted to the walgit-events crate)
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
The unit tests cannot show that the cursor round trip and the sink path
deliver what a folded checkpoint hid.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@cursor

cursor Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes durable cursor shape and webhook emission semantics on retention gaps; correctness-critical for event consumers but guarded by dedup keys, retries, and extensive tests.

Overview
When log entries are folded into a checkpoint before the webhook bridge reads them, consumers no longer miss ref changes: the bridge stores ref snapshots in events/cursor.json, and on a detected gap it synthesizes create / update / delete events via new refs_from_gap (diff between cursor refs and refs at the folding checkpoint, stamped with that checkpoint’s seq), then publishes the readable log tail so each ref’s old/new chain stays continuous.

Legacy cursors without a refs field still skip gap synthesis on the first gap (only the tail is emitted) and persist refs on the next successful pass. docs/EVENTS.md now describes bridge gap repair; JetStream behavior is unchanged (no ref baseline on the stream).

Integration tests cover the full folded-gap scenario and legacy-cursor behavior.

Reviewed by Cursor Bugbot for commit a948eab. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4a332220-d8d4-4e5c-8413-7fc9e0af7ef6
Commits

Reviewing files that changed from the base of the PR and between 2668870 and a948eab.

Files selected for processing: 4
  • crates/walgit-events/src/lib.rs
  • crates/walgit-server/src/bridge.rs
  • crates/walgit-server/tests/events.rs
  • docs/EVENTS.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a5f9336. Configure here.

Comment thread crates/walgit-server/src/bridge.rs Resolved
Comment thread crates/walgit-server/src/bridge.rs Resolved
…creates

A cursor without refs is not an empty snapshot, and the readable tail is
published from the log, so the gap must end at the folding checkpoint.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis yordis closed this Oct 29, 2026
@yordis yordis reopened this Oct 29, 2026
@yordis yordis closed this Oct 29, 2026
@yordis yordis reopened this Oct 29, 2026
@yordis
yordis merged commit 5a473dc into main Oct 29, 2026
10 of 15 checks passed
@yordis
yordis deleted the yordis/fix-events-folded-checkpoint-refs branch October 29, 2026 05:45
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