Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change log becomes out of sync when updating an object with tags via REST API #5973

Closed
brodie-roberts-ix opened this issue Mar 12, 2021 · 2 comments
Labels
status: duplicate This issue has already been raised type: bug A confirmed report of unexpected behavior in the application

Comments

@brodie-roberts-ix
Copy link

brodie-roberts-ix commented Mar 12, 2021

NetBox version

v2.10.4

Python version

3.8

Steps to Reproduce

  1. Create a Device with one or more tags assigned
  2. Update any other property of the Device by making a PATCH API request, but do not specify the "tags" field in the JSON. For example, send {"serial": "12345"} as the PATCH body.
  3. Click "Edit" on the same object in the UI, then click "Update" without making any changes.

Expected Behavior

  • The change log for operation 2 shows the serial field changing and nothing else.
  • The change log for operation 3 shows no change.

Observed Behavior

  • The change log for operation 2 shows the serial field changing AND the list of tags becoming empty. The actual object itself still shows its tags in the UI and via GET API request. It appears the change log has become out of sync with the actual object.
  • The change log for operation 3 shows the list of tags being restored to what it actually is. The change log becomes in sync with the actual object again.

Additional Notes

This appears to be directly related to #5118. I believe the fix to that issue introduced this bug, possibly on this line: 4466458#diff-48e44e81277ac8d14d08f8ce8e8753ef7a93f77ba9706945317c80744ede07e1R115

This doesn't appear to be a functional bug. However, this bug made it very difficult for me and my team as we were trying to learn how to properly interact with tags via the REST API.

@brodie-roberts-ix brodie-roberts-ix added the type: bug A confirmed report of unexpected behavior in the application label Mar 12, 2021
@jeremystretch
Copy link
Member

Thank you for submitting this issue, however it appears that this topic has already been raised. Please see issue #5583 for further discussion.

@jeremystretch jeremystretch added the status: duplicate This issue has already been raised label Apr 13, 2021
@brodie-roberts-ix
Copy link
Author

I think this ticket raised an issue not technically covered by #5583, but it looks like the overhaul to change logging being done in #5913 should cover it anyway. Will update if this issue persists for me in 2.11.

Cheers!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: duplicate This issue has already been raised type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants