avniproject / avni-webapp

Web application for management and data entry
https://avniproject.org
GNU Affero General Public License v3.0
10 stars 42 forks source link

Getting Data Integrity Violation Exception while saving the form. #1105

Closed himeshr closed 1 week ago

himeshr commented 7 months ago

Describe the bug I'm getting this error, not every time but pretty often. It happens when I try to save two form elements at once or when I create a new form element group and form element together simultaneously. Despite the error, everything seems to be saving correctly.

Why prioritised These kinds of failures are affecting the speed of implementation team impacting the costs.

To Reproduce env: prod, any org

  1. Go to Any form
  2. create and save two form elements, or a form element group and a form element together at the same time—instead of doing it separately.
  3. See error

Getting this error, not every time but pretty often. Not easy to reproduce this issue.

AC: Should save without showing the error.

Screenshots Image

mahalakshme commented 7 months ago

@himeshr I was unable to reproduce this issue on prerelease? Can you add 'steps to reproduce'?

himeshr commented 7 months ago

@himeshr I was unable to reproduce this issue on prerelease? Can you add 'steps to reproduce'?

@nupoorkhandelwal please add the steps to reproduce and then remove the WIP prefix from the title of the card.

adamsanadi6 commented 6 months ago

Screenshot from 2023-12-21 12-44-46

adamsanadi6 commented 6 months ago

Screencast from 20-12-23 11:17:58 AM IST.webm

mahalakshme commented 6 months ago

Steps to reproduce as per Adam: You can try to save two form elements at once or create a new form element group and form element inside it then save them at once not separately. This error is not coming every time.

1t5j0y commented 3 weeks ago

Issue was due to duplicate POST /forms API calls being triggered from webapp (since the api call was triggered within render() and the component was being re-rendered). Depending on the timing of the duplicate call, this issue was occurring intermittently or being treated as an update on the server. Data was still being saved successfully but the error message from the duplicate call response was being shown.

QA notes:

Check that validations and save works as before.