Skip to content

bug: component-backed net ports cannot be discovered or renamed on EasyEDA Pro 3.2.209 #56

Open

Description

@Buzzec

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-mcp 1.4.1
  • Bridge extension 0.5.1
  • Protocol 0.1.0
  • Active document: schematic
  • easyeda_doctor reports a healthy connection and compatible protocol.

Reproduction and observed results

  1. Open a schematic containing an existing Netport-BI symbol.
  2. Read it with easyeda_schematic_snapshot({ allPages: false, includeRaw: true }).
  3. 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.

  1. 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:

  1. Port discovery ignores componentType. The component fallback in schematicPortBusMutations.ts checks type ?? itemType ?? primitiveType. For the actual record above, that yields "Component", so the existing net port is discarded. Recognize componentType: "netport", and normalize SDK class instances using their state getters where needed.
  2. Mutation dispatch does not support component-backed ports. Port execution only tries sch_PrimitiveNetPort.modify / sch_PrimitivePort.modify. Component execution calls the generic component modify, 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" and componentType: "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

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions