Skip to content

BE-1255: Add the relay loop that publishes the entity outbox - #10703

Draft
TimDiekmann wants to merge 1 commit into
t/be-1254-store-a-relays-outbox-cursor-and-lockfrom
t/be-1234-publish-the-entity-outbox-from-a-relay
Draft

TimDiekmann wants to merge 1 commit into
t/be-1254-store-a-relays-outbox-cursor-and-lockfrom
t/be-1234-publish-the-entity-outbox-from-a-relay

Conversation

@TimDiekmann

Copy link
Copy Markdown
Member

🌟 Purpose

Nothing reads the entity outbox and hands its events on yet. This PR adds the loop that does, to hash-graph-relay.

🔍 Changes

  • Publisher is where the relay publishes an event. The relay moves its cursor past an event once publish returns Ok.
  • publish_page reads one page of the outbox after the relay's cursor, publishes it in cursor order and stores the cursor of the last published event. A failed publication ends the page, so the cursor never moves past it.
  • run takes the relay's lock, then publishes page by page until it is told to shut down. It returns every error, so its supervisor restarts it.
  • The crate gets a test:integration task, because its tests need the database.

⚠️ Known issues

  • Nothing runs the loop yet. The hash-graph relay subcommand follows.
  • run has no test of its own.
  • An event that keeps failing to publish makes the relay restart over and over.

@TimDiekmann TimDiekmann self-assigned this Dec 3, 2026
@vercel

vercel Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hash Ready Ready Preview Dec 3, 2026 11:18am UTC
petrinaut Ready Ready Preview Dec 3, 2026 11:18am UTC
petrinaut-docs Ready Ready Preview Dec 3, 2026 11:18am UTC
1 Skipped Deployment
Project Deployment Actions Updated
hashdotdesign-tokens Ignored Ignored Dec 3, 2026 11:18am UTC

Request Review

@github-actions github-actions Bot added area/deps Relates to third-party dependencies (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team area/tests New or updated tests labels Dec 3, 2026
@TimDiekmann
TimDiekmann added this pull request to stack #10688 December 3, 2026 11:14
@codecov

codecov Bot commented Dec 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 68 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.35%. Comparing base (8f68767) to head (28f8fc0).

Files with missing lines Patch % Lines
libs/@local/graph/relay/src/lib.rs 0.00% 68 Missing ⚠️
Additional details and impacted files
@@                                 Coverage Diff                                 @@
##           t/be-1254-store-a-relays-outbox-cursor-and-lock   #10703      +/-   ##
===================================================================================
- Coverage                                            70.37%   70.35%   -0.03%     
===================================================================================
  Files                                                 2142     2142              
  Lines                                               226459   226527      +68     
  Branches                                              9820     9820              
===================================================================================
  Hits                                                159367   159367              
- Misses                                               65041    65109      +68     
  Partials                                              2051     2051              
Flag Coverage Δ
hash-graph-relay 1.44% <0.00%> (-98.56%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch was successfully deployed

3 active deployments
Preview – hash — 28f8fc00 Deployed Dec 3, 2026 by vercel[bot]
Preview – petrinaut-docs — 28f8fc00 Deployed Dec 3, 2026 by vercel[bot]
Preview – petrinaut — 28f8fc00 Deployed Dec 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/deps Relates to third-party dependencies (area) area/libs Relates to first-party libraries/crates/packages (area) area/tests New or updated tests type/eng > backend Owned by the @backend team

Development

Successfully merging this pull request may close these issues.

1 participant