Fixes agent merging failing unexpectedly - #4699
Conversation
| @@ -308,7 +308,7 @@ def update_record(record: models.Model): | |||
|
|
|||
| response: http.HttpResponse = update_record(obj) | |||
| if response is not None and response.status_code != 204: | |||
There was a problem hiding this comment.
@CarolineDenis thanks for fixing this!
@acwhite211 on second thought, do we even need to handle response from update_record at all? I added handling the invalid http responses through FailedMergingException to preserve atomicity, which gets caught by the caller of this function. See here.
So, we can get rid of all the HTTP responses [here]. (
specify7/specifyweb/specify/record_merging.py
Lines 150 to 350 in 0751046
Here, now we define the 204 http in the try block, and return that.
specify7/specifyweb/specify/record_merging.py
Lines 45 to 64 in 0751046
I believe the testing instructions for record merging should be more detailed to ensure it functions correctly in various scenarios, not just this one. |
|
@specify/ux-testing To recreate the Issue from scratch:
In the below video, both Agents are referenced by at least one agent_merge_issue.movOther Agents can be associated with the merge (and even made as the 'Primary' agent) and the merge will still fail on Screen.Recording.2024-05-21.at.9.18.33.AM.movThis PR should resolve these errors from |
alesan99
left a comment
There was a problem hiding this comment.
- use herb32124 db
- merge two agents
- verify it works
- merge any other agents with any other db and verify it works as expected
I recreated the issue on KUFish by merging two agents linked to separate Collection Objects.
Merging now works successfully in this case 👍👍
chrome_fMZzv9j7qY.mp4
I also tested it with merging separate gift agents and unlinked agents. I could not get these cases to cause an error on production though.
emenslin
left a comment
There was a problem hiding this comment.
Testing instructions
-
use herb32124 db
-
merge two agents
-
verify it works
-
merge any other agents with any other db and verify it works as expected
Tried on other dbs with more than 2 agents as well
Fixes #4685
Checklist
and self-explanatory (or properly documented)
Testing instructions
use herb32124 db
merge two agents
verify it works
merge any other agents with any other db and verify it works as expected