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

File/Image delete causes 409 error response on page update #6129

Open
29avet1 opened this issue Dec 26, 2023 · 0 comments
Open

File/Image delete causes 409 error response on page update #6129

29avet1 opened this issue Dec 26, 2023 · 0 comments
Labels
pending Issues that are pending triage

Comments

@29avet1
Copy link

29avet1 commented Dec 26, 2023

  • Laravel Version: 10.19.0
  • Nova Version: 4.27.14
  • PHP Version: 8.2

Description:

When we delete a file or image on page edit, then we click the update button, it throws a 409 error "Another user has updated this resource since this page was loaded".
It is caused by the fact that after deleting the image it touches the row in db, sets the image name to null, and also "updated at" is getting refreshed. By this, the "retrieved_at" value is responsible for checking whether another person has edited this resource or not, becomes outdated.
I saw that the nova file input triggers an event "file-deleted", which in "HasOneFiled.vue" is handled and triggers another "update-last-retrieved-at-timestamp" event, which I suppose updates the retrieved_at value to avoid this issue, but in "Update.vue" the "handleFileDeleted" method is empty and not triggering the "update-last-retrieved-at-timestamp" event.

Detailed steps to reproduce the issue on a fresh Nova installation:

  1. open the Edit resource page with an image input. upload an image and save, or open an edit page that already contains an uploaded image
  2. delete the image, then click the "Update" button. it will throw an error.
@crynobone crynobone added the pending Issues that are pending triage label Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending Issues that are pending triage
Projects
None yet
Development

No branches or pull requests

2 participants