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

Agent Merging - Integrity Error #3801

Closed
carlosmbe opened this issue Jul 18, 2023 · 3 comments · Fixed by #3846
Closed

Agent Merging - Integrity Error #3801

carlosmbe opened this issue Jul 18, 2023 · 3 comments · Fixed by #3846
Assignees
Labels
1 - Bug Incorrect behavior of the product 2 - Merging
Milestone

Comments

@carlosmbe
Copy link
Contributor

carlosmbe commented Jul 18, 2023

Describe the bug
This Phantom error initially found by Jason in the development of Agent Merging has been resurrected and is in 7.9.

It's identifiable by the red line

#3474 (comment)

To Reproduce
Steps to reproduce the behavior:

  1. Go to NHMD -> Amber -> Queries
  2. Click on Agent Semantics
  3. Merge the Agents I listed below
  4. See error

Agents to Merge:

  • Scharff, Nikolaj
  • Hormiga, G
  • Newton, Alfred

Screenshots
Screenshot 2023-07-18 at 3 23 29 PM

Desktop:

  • OS: Mac
  • Browser: Chrome
  • Specify 7 Version: 7.9
@carlosmbe carlosmbe added the 1 - Bug Incorrect behavior of the product label Jul 18, 2023
@carlosmbe carlosmbe added this to the 7.9 milestone Jul 18, 2023
@melton-jason
Copy link
Contributor

As shown in #3474, there are two issues here: one with what's causing the error (#3474 (comment)), and how the error is displayed (#3474 (comment)).

The underlying cause of the issue here is all about the references to the agents.

To minimally recreate the issue:

  • Create two Agents
  • Create a Collecting Event with both Agents as Collectors
  • Create another Collecting Event with one of the Agents as a Collector
  • Try and merge the first two agents together
  • See the error

@realVinayak
Copy link
Contributor

This should be fixed though in #3846. Let's keep it open, and then close as resolved when testers test this

@realVinayak realVinayak reopened this Aug 4, 2023
@grantfitzsimmons
Copy link
Member

To close this issue, test the following:


Testing instructions:

For Issue #3801

I'll recommend running the below steps for at least some of Deaccession, Disposal, Loan, Accession, Gift, Borrow tables. Also test on both v7.9-dev and this branch. v7.9-dev shouldn't be able to merge these, and this branch should.

Later on, testers can go wild and merge anything into anything - and as long as it is not an actual business rule exception, it should work.

Steps:

  1. Make an interaction via the interactions form. I'll call it accession 001 for these steps. Make two new accession agents. I'll recommend creating two fresh new agents (but you can select a previous agent too). You can also make more than two accession agents. For this example, two new agents are agent 001 and agent 002. Important that both of these agents should be assigned same role in the accession.
  2. Make another accession, and select agent 002 and assign any role to this agent.
  3. Go into query builder, select agents agent 001 and agent 002.
  4. Merge agent 001 into agent 002. The order is important to recreate issue.
  5. This should fail in v7.9-dev, with an error saying found multiple records violating uniqueness constraints. In this branch, it should work without any errors.

To test lower order is taken in collector and determiners in case of deletion. v7.9 should take the most recently created one.

  1. Go to collectingevent form. Add a collector. Make a new agent for this (just for testing - can also be tested with existing ones). Calling this agent agent 001. In the remarks field, put some dummy value for this collector (this is to distinguish after merge).
    image
  2. Save collecting event form. I'll recommend waiting a few seconds before going to next step.
  3. Make another collector (with existing agent or new). Call this agent 002. Put some dummy value in remarks. Save the form.
  4. Merge agent 001 into agent 002.
  5. Go to collecting event form again. In the remarks, check the following:
    v7.9-dev should take the one most recently one (look at dummy value you put in remarks to confirm). This branch should take it by order (so the first one you created)

Try doing the exact same steps for determiners too.

@grantfitzsimmons grantfitzsimmons linked a pull request Sep 11, 2023 that will close this issue
@realVinayak realVinayak added this to the 7.9 milestone Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - Bug Incorrect behavior of the product 2 - Merging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants