Skip to content

Composite swap source/destination when source id > destination id#2432

Draft
andromeda-224 wants to merge 4 commits into
masterfrom
bugfix/composite-destroy-swap
Draft

Composite swap source/destination when source id > destination id#2432
andromeda-224 wants to merge 4 commits into
masterfrom
bugfix/composite-destroy-swap

Conversation

@andromeda-224

@andromeda-224 andromeda-224 commented Nov 20, 2025

Copy link
Copy Markdown
Collaborator

Prerequisites

  • Reviewed the checklist

  • Reviewed feedback from the "Sonar Cloud" bot. Note that you have to wait
    for the "CI / Unit Tests") to complete first. Failed Unit tests can be
    debugged by adding the label "verbose logging" to the GitHub PR.

Description of the Change

In addRecordStoreToGraph, when addTransaction is called and source id > destination id, the transaction source and destination will automatically be swapped when the transaction is created. So we have to swap the compositeTransactionId source and destination and the transactionValues so that they will match the newly added transaction.

ie. Assume that for undirected transactions, if the source id > destination id, that they will be swapped. So swap it in the compositeTransactionId (and the transactionValues which will be added to the new transaction).

Alternate Designs

Why Should This Be In Core?

Benefits

Possible Drawbacks

Verification Process

  1. Create a new graph with Experimental > Build Graph> Complete Graph Builder. In the popup dialog, add Transaction Type Relationship. Click Ok.
  2. Take note of the number of transactions, links, edges and nodes at the bottom right of the app.
  3. Select any 2 nodes and select Tools > Composite Selected Nodes. Note that the 2 nodes have been composited.
  4. Select Tools > Destroy all Composites. Note that the number of transactions, links, edges and nodes are the same as in step 2.
  5. Select 3 nodes and Tools > Composite Selected Nodes.
  6. Select Tools > Destroy all Composites. Note that the number of transactions, links, edges and nodes are the same as in step 2.

Import should not be affected:
Import a file with undirected transactions (ie. with relationship transaction types). All transactions should appear as expected.

Merge Nodes should not be affected:

  1. Create a new graph with Experimental > Build Graph> Complete Graph Builder. In the popup dialog, add Transaction Type Relationship. Click Ok.
  2. Take note of the number of transactions, links, edges and nodes at the bottom right of the app.
  3. Select any 2 nodes and select Tools > Merge Nodes. The 2 nodes will be merged.
  4. Select any 2 nodes again and select Tools > Merge Nodes. The nodes will be merged.
  5. Select undo twice. Note that the number of transactions, links, edges and nodes are the same as in step 2.

Applicable Issues

#2291

@andromeda-224 andromeda-224 added the verbose-logging test code in CI with verbose output label Nov 27, 2025
@sonarqubecloud

sonarqubecloud Bot commented Dec 4, 2025

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
52.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

This pull request is stale because it has been open for 6 months with no activity. Consider reviewing and taking an action on this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-pr-activity verbose-logging test code in CI with verbose output

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant