Skip to content

Misordered changelog entries after deleting a module with components #20699

@jeremystretch

Description

@jeremystretch

NetBox Edition

NetBox Community

NetBox Version

v4.4.4

Python Version

3.12

Steps to Reproduce

  1. Create a device with a module bay
  2. Create a module type with an interface
  3. Create a module of that type in the device
  4. Delete the module
  5. Inspect the changelog

Expected Behavior

The changelog entries should be ordered as follows (beginning from step 3 above):

  1. Create the module
  2. Create an interface on the module
  3. Delete the interface
  4. Delete the module

Observed Behavior

The changelog entries appear as:

  1. Create the module
  2. Create an interface on the module
  3. Delete the module
  4. Update the interface (appears to be a no-op?)
  5. Delete the interface

Although the result of the deletion is as expected (both the module and its interface have been removed), the changelog does not accurately reflect the order of operations: In reality, any components of the module are and must be deleted from the database prior to the deletion of the module itself to satisfy foreign key constraints.

It should be noted that similar patterns likely exist elsewhere in the application, where a cascading deletion of dependent objects is not accurately recorded in the changelog. The resolution of this bug should include an audit for all such instances.

Metadata

Metadata

Assignees

Labels

netboxseverity: lowDoes not significantly disrupt application functionality, or a workaround is availablestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions