Skip to content

Bulk device ops do not clean up associated records #6466

@Steve-Mcl

Description

@Steve-Mcl

Current Behavior

In working through Remove MCPRegistration entries on device and project deletion#6424 I noted that not only MCPRegistration were being orphaned but TeamBrokerClient were too when bulk delete of devices is operated.

Expected Behavior

Operating bulk deletion of devices should perform clean up of associated records

e.g. the same actions in afterDestroy of forge/db/models/Device.js should be performed in an afterBulkDestroy hook

Additionally, unit tests should be in place to ensure bulk ops clean up ALL associated DB entries.

Steps To Reproduce

  • Add 1 or more devices
  • add MCP and / or and AccessToken, BrokerClient, AuthClient, TeamBrokerClient
  • visit the Remote Devices page https://<server>/team/<team-id>/devices page
  • select 1 or more devices checkboxes
  • click "Actions"
  • click "Delete" to perform bulk operation
  • Check database tables for associated rows (those covered in the afterDestroy hook of forge/db/models/Device.js

Environment

  • FlowFuse version: Current / latest
  • Node.js version:
  • npm version:
  • Platform/OS:
  • Browser:

Have you provided an initial effort estimate for this issue?

I have provided an initial effort estimate

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageNeeds looking at to decide what to dosize:S - 2Sizing estimation point

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions