Skip to content

Lazy loaded fields do not block save and cause unexpected modificiations #7290

@moonrail

Description

@moonrail

NetBox version

v3.0.2

Python version

3.9

Steps to Reproduce

  1. Create e.g. a Device
  2. Edit the Device, save it as fast as possible (Edit -> directly to Save)
  3. Inspect error messages, that tell you, you should choose a Site, Device-Type and Device-Role

The time required to "wait" before saving anything is depending on the time lazy fields require to load their data.
So more data causes more time margin for this error to cause issues and increases its real life applicance.

Expected Behavior

A save without any changes should not omit data of the current instance of the model.

Observed Behavior

The POST is done before lazy loading is finished and seems to send null-values for the unfinished fields.
On NetBox instances with a lot of e.g. Sites, VLANs or else - anything that is loaded dynamically/loaded lazy, this issue becomes more and more apparent.

As you can see in the screenshot attached, the lazy loading of my local dev env (with nearly no data in it) took long enough to reproduce this error:

Screenshot_20210917_113220

Note: I have a simple CustomValidator with tenant required, therefore is Tenant also noted as required in screenshot.

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions