Skip to content

C5 follow-up: hydrate task-node conflicts from current_node (zero round-trip) #1274

Closed

Description

@malibio

Spun off from: #1268 (C5), review finding.

Context

In packages/core/src/ops/mod.rs, From<NodeServiceError> for OpsError converts NodeServiceError::VersionConflict with current_node: None unconditionally. This conversion is used by the task-node update path (update_task_node in the daemon).

For regular node conflicts, node_ops::update_node calls node_service.get_node() after the conflict and populates current_node before constructing OpsError::VersionConflict. The task-node path does not do this.

Current behavior

When a task-node write produces a VersionConflict:

  • The daemon still emits the x-version-conflict header (correct)
  • But current_node is always null in the payload
  • The frontend's task-node OCC site correctly falls back to resyncNodeFromServer (no data loss)
  • This causes an extra gRPC round-trip to fetch the authoritative state

Target behavior

Fetch current_node in the task-node OCC path, the same way node_ops::update_node does:

// In packages/daemon/src/services/node_service.rs: update_task_node handler
// or in packages/core/src/ops/ if a task_node_ops module is added
Err(NodeServiceError::VersionConflict { node_id, expected_version, actual_version }) => {
    let current_node = node_service.get_node(&node_id).await
        .ok().flatten()
        .and_then(|n| serde_json::to_value(&n).ok());
    return Err(OpsError::VersionConflict { node_id, expected: expected_version, actual: actual_version, current_node });
}

Acceptance criteria

  • Task-node VersionConflict populates current_node in the daemon OCC payload
  • x-version-conflict header carries a non-null current_node for task conflicts
  • Frontend task-node OCC site hydrates from current_node instead of resyncing (one less round-trip)
  • Existing error_mapping_version_conflict_returns_aborted test updated to reflect the change

Priority: backend — low urgency (no data loss in current behavior, just an extra round-trip).

Activity

  1. added 2 commits that reference this issue on May 30, 2026
    61711df
    7b344af
  2. added a commit that references this issue on Jun 22, 2026
    6f8eebe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions