Commit 51bed5b
authored
fix(composition): Handle output type covariance properly in satisfiability (#3277)
This PR fixes two bugs in the satisfiability code when the subgraph type differs from the supergraph type due to output type covariance:
1. It now handles no-op inline fragments when advancing a subgraph path with a graph transition.
- Previously, the code assumed this was impossible, but it can happen in the case of output type covariance where the subgraph type matches the inline fragment type, which doesn't match the supergraph type. Since we don't store no-op edges in the query graph, this led to no edge being found, making satisfiability believe the transition was mistakenly unsatisfiable.
2. The data of previous vertex visits now additionally includes the tail's type name for a given subgraph path.
- Previously, the code assumed the tail's type name always matched the type name of the vertex in the key of the previous vertex visit state store. This is not the case when there's output type covariance, which led to satisfiability mistakenly believing a previous vertex visit was matching the current one (i.e. a loop's been detected) when it wasn't.1 parent 7799ad1 commit 51bed5b
File tree
3 files changed
+17
-1
lines changed- .changeset
- composition-js/src
- query-graphs-js/src
3 files changed
+17
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
641 | 641 | | |
642 | 642 | | |
643 | 643 | | |
| 644 | + | |
644 | 645 | | |
645 | 646 | | |
646 | 647 | | |
| |||
649 | 650 | | |
650 | 651 | | |
651 | 652 | | |
652 | | - | |
| 653 | + | |
653 | 654 | | |
654 | 655 | | |
655 | 656 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1735 | 1735 | | |
1736 | 1736 | | |
1737 | 1737 | | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
1738 | 1747 | | |
1739 | 1748 | | |
1740 | 1749 | | |
| |||
0 commit comments