Repository navigation
Description
Problem
Existing schematic net-port symbols can be read by easyeda_schematic_snapshot, but cannot be renamed through either the port mutation tool or the component mutation tool.
This was observed while trying to rename an existing net from ETH_SCSN to ETH_SCS_N. No rename was applied.
Environment
- Windows desktop
- EasyEDA/JLCEDA Pro 3.2.209
@vlabsoftware/easyeda-pro-mcp1.4.1- Bridge extension 0.5.1
- Protocol 0.1.0
- Active document: schematic
easyeda_doctorreports a healthy connection and compatible protocol.
Reproduction and observed results
- Open a schematic containing an existing Netport-BI symbol.
- Read it with
easyeda_schematic_snapshot({ allPages: false, includeRaw: true }). - Use that symbol's primitive ID with:
{
"action": "modifyPort",
"portId": "<existing-net-port-primitive-id>",
"name": "ETH_SCS_N"
}easyeda_prepare_schematic_port returns not_found: Port with id '<id>' not found in active schematic.
- Trying the same ID through
easyeda_prepare_schematic_component:
{
"action": "update",
"component": "<existing-net-port-primitive-id>",
"properties": {
"net": "ETH_SCS_N",
"name": "ETH_SCS_N"
}
}Preparation succeeds and previews an update to [net, name]. Executing the prepared mutation through easyeda_confirmed_action fails with this native error:
仅当器件类型为元件时允许使用该函数进行修改
Translation: this modification function is only allowed when the device type is a regular component.
The retained mutation result reports status: "failed", phase: "settled", and documentSaved: false.
Relevant runtime evidence
The snapshot's raw record contains the following fields (IDs and unrelated properties omitted):
{
"primitiveType": "Component",
"componentType": "netport",
"net": "ETH_SCSN",
"name": "ETH_SCSN",
"component": { "name": "Netport-BI" },
"symbol": { "name": "Netport-BI" }
}The live capability report includes:
{
"sch_PrimitiveComponent.getAll": true,
"sch_PrimitiveComponent.get": true,
"sch_PrimitiveComponent.modify": true,
"sch_PrimitiveNetPort.getAll": false,
"sch_PrimitiveNetPort.create": true,
"sch_PrimitiveNetPort.modify": false,
"sch_PrimitiveNetPort.delete": false
}Likely cause and possible fix
Source inspection suggests two separate gaps:
- Port discovery ignores
componentType. The component fallback in schematicPortBusMutations.ts checkstype ?? itemType ?? primitiveType. For the actual record above, that yields"Component", so the existing net port is discarded. RecognizecomponentType: "netport", and normalize SDK class instances using their state getters where needed. - Mutation dispatch does not support component-backed ports. Port execution only tries
sch_PrimitiveNetPort.modify/sch_PrimitivePort.modify. Component execution calls the generic componentmodify, which rejects this subtype.
Please add a capability-checked adapter for renaming component-backed net ports using the native port/net-state editing mechanism supported by the connected SDK version. The exact write mechanism still needs validation in a live 3.2.209 editor; fixing discovery alone will not fix execution. If no supported write mechanism exists, reject during preparation with a clear capability_unavailable error rather than not_found or a misleading valid component-update preview.
Suggested regression coverage:
- A realistic record with
primitiveType: "Component"andcomponentType: "netport". - Port-specific enumeration/modification APIs absent.
- Generic component modification rejecting non-component subtypes.
- Successful rename readback verifying the actual net name while preserving primitive identity, position, orientation, and connectivity.
- Unsupported versions failing before execution.
The existing modifyPort test mocks the port-specific APIs as available, so it does not cover this configuration.
Related work
#52 / #53 fixed wire rename readback in v1.4.1. This report concerns existing net-port symbols, and reproduces with those released versions already installed.
Activity