Skip to content

Deleting a custom widget on the screen results in a NotFoundException error on the device and the appearance of an undeletable "phantom" widget in the web interface. #19

@kfattum

Description

@kfattum

Deleting a custom widget via the /extensions page while it is still placed on a screen leaves an orphaned reference. This results in the error Error: NotFoundException: Custom widget not found being displayed on the device screen and the web interface breaking, leaving a "phantom" widget that cannot be interacted with or removed.
Image
Steps to Reproduce:

  1. Open the screen designer (e.g., http://<ip>/screens/designer/13) and add a custom widget to the screen.
  2. Go to the extensions page (http://<ip>/extensions) and delete this custom widget.
  3. Check the device and the Web UI.

Actual Behavior:

  • Device: The error Error: NotFoundException: Custom widget not found is displayed on the screen.
  • Web interface: The error is not displayed. The widget remains visible in the Active Widgets list, but it cannot be deleted through the interface.

Expected Behavior:
Deleting a custom widget from the extensions page should either automatically remove instances of it from all screens, or the Web UI should gracefully handle the missing reference, show an error, and allow the user to delete the broken widget from the canvas.

Technical Details:
When the bug occurs, the screen's JSON payload loses the customWidgets object entirely, but the widgets array still retains the element referencing the deleted customWidgetId (e.g., 81).

{
  "_inkerScreen": 2,
  "name": "Untitled Design",
  "widgets": [
    {
      "templateId": 10081,
      "config": {
        "customWidgetId": 81,
        "displayType": "script"
        // ... script data
      }
    }
  ],
  "customWidgets": [
    {
      "id": 81,
      "name": "test"
      // ... widget definition
    }
  ]
}
{
  "_inkerScreen": 2,
  "name": "Untitled Design",
  "widgets": [
    {
      "templateId": 10081,
      "config": {
        "customWidgetId": 81,
        "displayType": "script"
        // ... script data
      }
    }
  ]
  // "customWidgets" array is completely missing, causing the NotFoundException
}

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