Title: id-events: preserve empty event bodies across range sync · Issue #14907 · developing-today/code · GitHub
Open Graph Title: id-events: preserve empty event bodies across range sync · Issue #14907 · developing-today/code
X Title: id-events: preserve empty event bodies across range sync · Issue #14907 · developing-today/code
Description: Problem PR #7657's range-sync record frames the event as a length-prefixed header followed by raw body bytes. The decoder treats an empty remainder as None. The store accepts a present empty body (Some([])) when its signed header commits...
Open Graph Description: Problem PR #7657's range-sync record frames the event as a length-prefixed header followed by raw body bytes. The decoder treats an empty remainder as None. The store accepts a present empty body (...
X Description: Problem PR #7657's range-sync record frames the event as a length-prefixed header followed by raw body bytes. The decoder treats an empty remainder as None. The store accepts a present empty bo...
Opengraph URL: https://github.com/developing-today/code/issues/14907
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"id-events: preserve empty event bodies across range sync","articleBody":"## Problem\n\nPR #7657's range-sync record frames the event as a length-prefixed header followed by raw body bytes. The decoder treats an empty remainder as `None`. The store accepts a present empty body (`Some([])`) when its signed header commits to BLAKE3(empty) and size 0, so range sync turns that valid body into a header-only event. The receiver's `event_body` then returns `MissingBody`.\n\nThe ambiguity is still present on current main in `pkgs/id/crates/id-events/src/event_store/sync.rs`: `encode_record` appends no bytes for either `None` or `Some(&[])`, and `decode_record` maps every empty remainder to `None`. The later sync hardening in PR #11265 added device-operation delivery coverage with a non-empty body but did not change this framing.\n\n## Acceptance\n\n- The range-sync record format distinguishes an absent body from a present empty body.\n- A header-only event still arrives without a body; a present empty body arrives as `Some([])` and reads back byte-identically; a non-empty body also remains byte-identical.\n- The receiver continues to verify the body against the signed header's payload hash and size before storing it.\n- Add tests with an explicit oracle for all three cases, including an empty payload whose header commits to BLAKE3(empty) and size 0.\n\n## Evidence\n\n- Merged PR #7657 introduced `encode_record` / `decode_record` and generic body range sync; the event-body issue #4837 is closed.\n- Current main still decodes an empty body remainder as `None`; no later merged change to the record framing was found. PR #11265 tests a non-empty device-operation body.\n- No existing issue for present-empty event bodies in range sync was found in the current issue search.\n\n## Scope\n\nFix the range-sync record framing and its event-store tests. Preserve the existing batch transaction and header commitment checks. Do not change the event body format or the one-time store migration.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-25T06:54:34Z","url":"https://github.com/developing-today/code/issues/14907"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f52dddc3-fad9-c7d8-392a-225fa5af5fcd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D188:2B95F3:21F787:2DBA2C:6B074DEB |
| html-safe-nonce | 47d2bd85e67234b0a509fb4bba42e19937c51fc7da6f0c340fbd319ed490f30a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTg4OjJCOTVGMzoyMUY3ODc6MkRCQTJDOjZCMDc0REVCIiwidmlzaXRvcl9pZCI6IjI2NzQwNzk3MTE1MzM0MjAwMTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0fe3b1b0a4f50ebc882e85fc8abdc4c60dde98f659bc665a01b34e1b6df6097e |
| hovercard-subject-tag | issue:6599006785 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/14907/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9ce71669ffbc5f352765910e2c5d4ef512dedb3db26675846f149a97e83d5b15/developing-today/code/issues/14907 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9ce71669ffbc5f352765910e2c5d4ef512dedb3db26675846f149a97e83d5b15/developing-today/code/issues/14907 |
| og:image:alt | Problem PR #7657's range-sync record frames the event as a length-prefixed header followed by raw body bytes. The decoder treats an empty remainder as None. The store accepts a present empty body (... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 26f151990bcb5b67b87df8b3f96ed340f849939d44e36f348402de5e39cca989 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cd00d8452bcb4e56a60ba7c0e61a697b46513fe9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width