From 73b560de993dd432ef8bf3e196f8833aaf00dcfe Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Thu, 24 Sep 2026 15:09:01 +0300 Subject: [PATCH] fix(plugin): append the multi-entity command steps after the existing ones MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #1469 inserted `CommitMany` and `CommitManyAndEnd` between `Commit`, `CommitAndEnd` and `Done`. `CommandStep` crosses the plugin IPC, which encodes a variant by its position, so a plugin built against the previous API that answered `Done` would have been read as `CommitAndEnd` — or rejected as undecodable — by the new host. The two variants now sit after `Cancel`, as the other additions to the v7 wire types do. Co-Authored-By: Claude Opus 5.5 --- crates/ocs_plugin_api/src/host.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/ocs_plugin_api/src/host.rs b/crates/ocs_plugin_api/src/host.rs index 9208f91fd..22e1d80dc 100644 --- a/crates/ocs_plugin_api/src/host.rs +++ b/crates/ocs_plugin_api/src/host.rs @@ -710,16 +710,20 @@ pub enum CommandStep { NeedPoint, /// Commit an entity to the document and keep collecting points. Commit(EntityType), - /// Commit multiple entities to the document and keep collecting points. - CommitMany(Vec), /// Commit an entity and end the command. CommitAndEnd(EntityType), - /// Commit multiple entities to the document and end the command. - CommitManyAndEnd(Vec), /// End the command without committing. Done, /// Cancel the command. Cancel, + // New variants go after the existing ones: the step crosses the plugin + // IPC, which encodes a variant by its position, so inserting one earlier + // would make a plugin built against the previous API send `Done` and + // have the host read it as something else. + /// Commit multiple entities to the document and keep collecting points. + CommitMany(Vec), + /// Commit multiple entities to the document and end the command. + CommitManyAndEnd(Vec), } /// Export a `BuiltinPlugin` from a `cdylib` so the host can load it at runtime.