Skip to content

ObjectChange incorrect ordering for GenericRelation references #19680

@arthanson

Description

@arthanson

Deployment Type

Self-hosted

NetBox Version

v4.3.2

Python Version

3.12

Steps to Reproduce

  1. Create a device with an interface and connect a cable to it to another interface (you can use the imports below)
  2. delete the device
  3. Check the ChangeLog for the ordering of the Change Logs
Create Device Role "test":
name,slug,color
"test","test",888888

Create Manufacturer "test":
name,slug
"test","test"

Create Device Type "test":
manufacturer,model,slug,u_height
"test","test","test",1.0

Create Site "test":
name,slug,status
"test","test",active

Create Device "test" and "test2":
role,manufacturer,device_type,status,site,name
"test","test","test",active,"test","test"
"test","test","test",active,"test","test2"

Create Interfaces on the 2 test devices:
device,name,type
test,1,1000base-tx
test2,1,1000base-tx

Create Cable:
side_a_device,side_a_type,side_a_name,side_b_device,side_b_type,side_b_name,label
test,dcim.interface,1,test2,dcim.interface,1,"test:1,test2:1"

Expected Behavior

The changelog for this deletion (by date-time) should be:
Device
Interface
CableTermination

This is because of the dependency chain: the CableTermination relies on the Interface and the Interface relies on the Device. This is required when playing back the ChangeLog to reconstruct data, otherwise the CableTermination will get created before the Interface and fail.

Observed Behavior

You will see the order (by date-time) of the ChangeLog records will be:
Device
CableTermination
Interface
Image

Metadata

Metadata

Assignees

Labels

severity: 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