You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Engagements: don't bother checking :Property labels on active properties (#3401)
3739399 Introduced the pattern
```cypher
(:Engagement)--(project)-[:name { active: true }]->(name:Property)
```
We have a few engagements in production that have had their projects deleted.
But we have not cascaded that delete to the engagement.
The deleted project now as the form
```cypher
(:Deleted_Project)-[:name { active: true }]->(name:Deleted_Property)
```
These engagements are being referenced in `Language.sponsorStartDate`.
Requiring the engagement have a project with a name like
```cypher
-[:name]->(:Property)
```
caused the whole engagement to be _not found_, since this required pattern didn't match.
The `sponsorStartDate` is synced to DOMO, and that sync expects, as an admin, to be able to read this field.
It is throwing now and causing that entire language sync to fail.
What have I have here is IMO the fastest fix.
It is just removing the constraint that the active project name have a `:Property` label.
It is really redundant with the relationship constraint: `-[:name { active: true }]->()` this gives us all the specificity we need.
Really it is only [line 973](https://github.com/SeedCompany/cord-api-v3/pull/3401/files#diff-bb8050b85eee2fe8fe8cf88db83676730882a47e87cee4f15be3c8fc24b4ed34L973) that is the problem; but it seems sane to apply the concept everywhere, at least in this file for now.
A more holistic solution needs to be worked out for cascading deletes. Deleting a project should delete all engagements, products, etc. I'll leave that for a follow up. Maybe there's something we do or maybe a short term fix until we can migrate to Gel.
0 commit comments