-
Notifications
You must be signed in to change notification settings - Fork 3
Description
'Discard Changes' and Discard 'Changed Recursively' can lead to query results sets with elements that got removed in the discard process.
Environment
MD 19.0 but this seems to be the case in CSM 19sp2 as well
V4MD 2.3.0
My testing covered edges (abstraction, dependency, etc..) but it may be the case with other elements as well.
To reproduce this:
- pick an edge type element like an abstraction that is returned by a query
- delete the element
- create another element in its place (meaning that the supplier and the client are the same and it is in the same package, name does not matter)
- discard the new element (this brings back the old)
The query will return the new element that just got removed.
Minimal working example
I set up an example to test this on TWC (internal)
V4MD-test > v4md-debug
And made a test plugin of the MD Plugin Skeleton
https://github.com/IncQueryLabs/MD_plugin_skeleton/commits/v4md-debug
Usage
The model structure is the following:
The Query I use:
pattern edgeTest(edge: Abstraction){
Abstraction.client.name(edge, "UniqueAbstractionClient");
Abstraction.supplier.name(edge, "UniqueAbstractionSupplier");
}
To run the query and display name and ids
The output of the first run:
[2020.06.02::17:09:33] | -------------------------------------
[2020.06.02::17:09:34] | +++
[2020.06.02::17:09:34] | Name: Edge Under Test
[2020.06.02::17:09:34] | getLocalID: _19_0_175c043b_1591107324833_950275_6
[2020.06.02::17:09:34] | getID: 32e9bd76-e888-4826-9092-3a1e6e44fece
[2020.06.02::17:09:34] | sGetID: 32e9bd76-e888-4826-9092-3a1e6e44fece
[2020.06.02::17:09:34] | +++
[2020.06.02::17:09:34] | -------------------------------------
I delete this abstraction and create a new one with the same endpoints and call it New Abstraction
Re-run the action:
[2020.06.02::17:12:19] | -------------------------------------
[2020.06.02::17:12:19] | +++
[2020.06.02::17:12:19] | Name: New Abstraction
[2020.06.02::17:12:19] | getLocalID: _19_0_175c043b_1591110668849_450906_2
[2020.06.02::17:12:19] | getID: b44d438c-9e58-4b38-850d-bec1451ae3e6
[2020.06.02::17:12:19] | sGetID: b44d438c-9e58-4b38-850d-bec1451ae3e6
[2020.06.02::17:12:19] | +++
[2020.06.02::17:12:19] | -------------------------------------
Now I discard changes
And run the action again:
[2020.06.02::17:13:46] | -------------------------------------
[2020.06.02::17:13:46] | +++
[2020.06.02::17:13:46] | Name: New Abstraction
[2020.06.02::17:13:46] | getLocalID: _19_0_175c043b_1591110668849_450906_2
[2020.06.02::17:13:46] | getID: b44d438c-9e58-4b38-850d-bec1451ae3e6
[2020.06.02::17:13:46] | sGetID: b44d438c-9e58-4b38-850d-bec1451ae3e6
[2020.06.02::17:13:46] | +++
[2020.06.02::17:13:46] | -------------------------------------



