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

Matching failed: Duplicate Relationship #18

Open
bjendres opened this issue Apr 2, 2020 · 5 comments
Open

Matching failed: Duplicate Relationship #18

bjendres opened this issue Apr 2, 2020 · 5 comments
Labels
bug Something isn't working feature needs funding

Comments

@bjendres
Copy link
Member

bjendres commented Apr 2, 2020

@nicol reports:

"CiviCRM_API3_Exception: "Matching failed: Duplicate Relationship".

If the only new records are coming through the forms then this probably isn't an issue as there's no way to create both a request and an offer together in the same record (only via import or adminastrator config).
But am guessing longer term there may be scenarios where the same person is both offering and requesting things.

@bjendres bjendres added the bug Something isn't working label Apr 2, 2020
@bjendres
Copy link
Member Author

bjendres commented Apr 2, 2020

I think this exception would probably occur, if there is multiple active relationships for one offer-request pair. The scenario I could think of would be:

  1. helpee A requests one type of help
  2. request gets matched to helper B
  3. the relationship gets confirmed
  4. helpee A adds a new help type to his/her request
  5. the new request also gets matched to helper B
  6. the current algorithm would now try to create a second (active) helper relationship between the two, and I think CiviCRM doesn't allow that.

@nicol: Does that sound plausible to you?

@bjendres bjendres added this to the 1.1 milestone Apr 2, 2020
@vingle
Copy link
Contributor

vingle commented Apr 2, 2020

Hey - sorry didn't see this as @vingle here.

Yeh that sounds like it. It also crossed my mind that someone might receive help and a month later they are recoverred and immune and offering help - so the relationship would get created in the other direction. Sounds like an edge-case, tho is there any way the matching issues report could pick it up?

@bjendres
Copy link
Member Author

bjendres commented Apr 2, 2020

The other way around shouldn't be an issue.

@bjendres
Copy link
Member Author

bjendres commented Apr 2, 2020

I have put some code into place so this edge case doesn't crash the matcher any more, and released it with 1.1-beta2

@bjendres
Copy link
Member Author

bjendres commented Apr 2, 2020

A proper fix for this would be, to amend an already existing relationship (for a different help type), but then the question is whether this needs confirmation again, and how to communicate the change.... We won't look into this until somebody really needs it.

@bjendres bjendres removed this from the 1.1 milestone Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature needs funding
Projects
None yet
Development

No branches or pull requests

2 participants