Skip to content

Record the user behind each peer, with last-writer-wins registration - #4635

Merged
TrueDoctor merged 2 commits into
masterfrom
graph-storage-1-users
Oct 5, 2026
Merged

TrueDoctor merged 2 commits into
masterfrom
graph-storage-1-users

Conversation

@TrueDoctor

Copy link
Copy Markdown
Member

No description provided.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 13 files

Confidence score: 2/5

  • registry.rs changes the serialized peer value, so existing v1 Postcard snapshots fail to decode as Registry when open_in reads them. Add a versioned migration or replay fallback before changing the stored format.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="document/graph-storage/src/registry.rs">

<violation number="1" location="document/graph-storage/src/registry.rs:13">
P1: This changes the serialized value for each registered peer, so existing v1 Postcard snapshots fail to decode as `Registry`; `open_in` reads them directly without a migration or replay fallback. Add a versioned conversion from legacy `UserId` values before changing this persisted shape.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

/// Registered by each device's first contribution via `RegistryDelta::RegisterPeer`.
pub peer_users: HashMap<PeerId, UserId>,
/// Which person each device is, from `RegistryDelta::RegisterPeer`, so undo and authorship scope by person.
pub peer_users: HashMap<PeerId, PeerRegistration>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1: This changes the serialized value for each registered peer, so existing v1 Postcard snapshots fail to decode as Registry; open_in reads them directly without a migration or replay fallback. Add a versioned conversion from legacy UserId values before changing this persisted shape.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At document/graph-storage/src/registry.rs, line 13:

<comment>This changes the serialized value for each registered peer, so existing v1 Postcard snapshots fail to decode as `Registry`; `open_in` reads them directly without a migration or replay fallback. Add a versioned conversion from legacy `UserId` values before changing this persisted shape.</comment>

<file context>
@@ -9,12 +9,18 @@ pub struct Registry {
-	/// Registered by each device's first contribution via `RegistryDelta::RegisterPeer`.
-	pub peer_users: HashMap<PeerId, UserId>,
+	/// Which person each device is, from `RegistryDelta::RegisterPeer`, so undo and authorship scope by person.
+	pub peer_users: HashMap<PeerId, PeerRegistration>,
 	pub attributes: Attributes,
 }
</file context>

Comment thread document/format/src/session_state.rs
Comment thread document/graph-storage/src/document.rs Outdated
Comment thread document/graph-storage/src/registry.rs
Comment thread node-graph/rfcs/document-format.md Outdated

@timon-schelling timon-schelling left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mostly just inconsistent terms used. And I don't get why we need this but I assume that will make more sense once I look at the rest of the stack.

Comment thread document/graph-storage/src/document.rs Outdated
Comment thread document/graph-storage/src/session.rs Outdated
Comment thread node-graph/rfcs/document-format.md Outdated
Comment thread document/graph-storage/src/registry.rs Outdated
@TrueDoctor
TrueDoctor force-pushed the graph-storage-1-users branch from f983cef to c446c74 Compare October 5, 2026 20:40
@TrueDoctor
TrueDoctor added this pull request to the merge queue Oct 5, 2026
Merged via the queue into master with commit e38fab2 Oct 5, 2026
9 of 11 checks passed
@TrueDoctor
TrueDoctor deleted the graph-storage-1-users branch October 5, 2026 21:07

This branch was successfully deployed

1 active deployment
graphite-dev (Preview) — c446c744 Deployed Oct 5, 2026 by github-actions[bot]
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.

2 participants