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

🐞[BUG] After synchronization supplier part turns into own part #1271

Open
ds-crehm opened this issue Jul 23, 2024 · 1 comment
Open

🐞[BUG] After synchronization supplier part turns into own part #1271

ds-crehm opened this issue Jul 23, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ds-crehm
Copy link
Contributor

ds-crehm commented Jul 23, 2024

Description

On E2E-A I synchronized a supplier part. Afterwards it turned into an own part.
Now the part has two owners.

Current behaviour

On E2E-A I synchronized the part urn:uuid:f11ddc62-3bd5-468f-b7b0-110fe13ed0cd which was shown as supplier part before but is now an own part:
Image
On E2E-B the part is still shown as own part:
Image

Expected behavior

It should not be possible for a part to have two owners. After synchronization I would expect the owner to stay the same.
One assumption is that the part is duplicated in the IRS (one as own part, one as supplier part) and after synchronization one of them is randomly selected (based on which one was first fetched?).

Steps to reproduce the Bug

This may not always work (depending on which owner is shown in the first place and how the process works)

  1. Restart application and import + synchronize parts
  2. Check the owner of the part urn:uuid:f11ddc62-3bd5-468f-b7b0-110fe13ed0cd
  3. Synchronize that part
  4. Check the owner again

Root cause: #1271 (comment)

The issue appears when trying to sync a traversal aspect (singleLevelBomAsBuilt) or similiar directly with irs instead of doing a registry reload.

  1. Open frontend
  2. Select customer or supplier part (only one)
  3. Click sync asset
  4. Part will be mapped to OWN part.
@ds-crehm ds-crehm added this to Trace-X Jul 23, 2024
@github-project-automation github-project-automation bot moved this to inbox in Trace-X Jul 23, 2024
@ds-crehm ds-crehm moved this from inbox to backlog in Trace-X Jul 23, 2024
@ds-crehm ds-crehm added bug Something isn't working R24.8 labels Jul 23, 2024
@ds-crehm ds-crehm changed the title 🐞After synchronization supplier part turns into own part 🐞[BUG] After synchronization supplier part turns into own part Jul 23, 2024
@ds-mwesener ds-mwesener removed the status in Trace-X Jul 30, 2024
@ds-mwesener ds-mwesener moved this to next in Trace-X Jul 30, 2024
@ds-mwesener ds-mwesener moved this from next to wip in Trace-X Jul 30, 2024
@ds-lcapellino
Copy link
Contributor

I took a closer look to the issue:
When we try to synchronize a Customer/Supplier Part in the frontend, we create a Job at IRS for that asset ID and the Job looks as follows:

	"job": {
		"id": "459a7b75-c6b0-4c34-8aa2-0e8815b2e724",
		"globalAssetId": "urn:uuid:f11ddc62-3bd5-468f-b7b0-110fe13ed0cd",
		"state": "COMPLETED",
		"exception": null,
		"createdOn": "2024-08-01T09:01:48.79869016Z",
		"startedOn": "2024-08-01T09:01:51.76812069Z",
		"lastModifiedOn": "2024-08-01T09:02:58.309457793Z",
		"completedOn": "2024-08-01T09:02:58.309458093Z",
		"summary": {
			"asyncFetchedItems": {
				"running": 0,
				"completed": 2,
				"failed": 0
			}
		},
		"parameter": {
			"bomLifecycle": "asBuilt",
			"aspects": [
				"urn:samm:io.catenax.batch:3.0.0#Batch",
				"urn:samm:io.catenax.serial_part:3.0.0#SerialPart",
				"urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt",
				"urn:samm:io.catenax.just_in_sequence_part:3.0.0#JustInSequencePart",
				"urn:samm:io.catenax.traction_battery_code:2.0.0#TractionBatteryCode"
			],
			"depth": 2,
			"bpn": "BPNL000000000UKM",
			"direction": "downward",
			"collectAspects": true,
			"lookupBPNs": true,
			"auditContractNegotiation": true,
			"callbackUrl": "https://traceability-int-a.int.catena-x.net/api/irs/job/callback?id={id}&state={state}"
		}
	},
	"relationships": [
		{
			"catenaXId": "urn:uuid:f11ddc62-3bd5-468f-b7b0-110fe13ed0cd",
			"linkedItem": {
				"quantity": {
					"quantityNumber": 1.0,
					"measurementUnit": {
						"datatypeURI": null,
						"lexicalValue": "unit:piece"
					}
				},
				"lifecycleContext": "asBuilt",
				"assembledOn": "2018-09-17T14:48:54.709Z",
				"lastModifiedOn": "2022-02-03T14:48:54.709Z",
				"childCatenaXId": "urn:uuid:4a5e9ff6-2d5c-4510-a90e-d55af3ba502f",
				"hasAlternatives": false
			},
			"aspectType": "SingleLevelBomAsBuilt",
			"bpn": "BPNL000000000UKM"
		}
	],
	"shells": [
		{
			"contractAgreementId": "8dbb81b9-8a42-4496-84d7-28155a7b2890",
			"payload": {
				"administration": null,
				"description": [],
				"globalAssetId": "urn:uuid:f11ddc62-3bd5-468f-b7b0-110fe13ed0cd",
				"idShort": "b/testDoorf-l-713425721c3f4e51a5ef422ec0845091",
				"id": "urn:uuid:8e089899-8835-41d0-bb88-1577e496930a",
				"specificAssetIds": [
					{
						"name": "partInstanceId",
						"subjectId": null,
						"externalSubjectId": {
							"keys": [
								{
									"value": "BPNL000000000UKM",
									"type": "GlobalReference"
								}
							],
							"type": "ExternalReference"
						},
						"value": "NO-004314332935115065980115",
						"semanticId": null
					},
					{
						"name": "manufacturerId",
						"subjectId": null,
						"externalSubjectId": {
							"keys": [
								{
									"value": "BPNL000000000UKM",
									"type": "GlobalReference"
								}
							],
							"type": "ExternalReference"
						},
						"value": "BPNL000000000DWF",
						"semanticId": null
					}
				],
				"submodelDescriptors": [
					{
						"administration": null,
						"description": [],
						"idShort": "urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt",
						"id": "urn:uuid:37c8183e-8ae2-4135-80fd-f6c82005ccd4",
						"semanticId": {
							"keys": [
								{
									"value": "urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt",
									"type": "GlobalReference"
								}
							],
							"type": "ExternalReference"
						},
						"endpoints": [
							{
								"protocolInformation": {
									"href": "https://trace-x-edc-int-a-dataplane.int.catena-x.net/api/public/urn:uuid:37c8183e-8ae2-4135-80fd-f6c82005ccd4",
									"endpointProtocol": "HTTP",
									"endpointProtocolVersion": [
										"1.1"
									],
									"subprotocol": "DSP",
									"subprotocolBody": "id=urn:uuid:6e1270db-dc82-4019-9a23-4028a95ad214;dspEndpoint=https://trace-x-edc-int-a.int.catena-x.net",
									"subprotocolBodyEncoding": "plain",
									"securityAttributes": [
										{
											"type": "NONE",
											"key": "NONE",
											"value": "NONE"
										}
									]
								},
								"interface": "SUBMODEL-3.0"
							}
						]
					},
					{
						"administration": null,
						"description": [],
						"idShort": "urn:samm:io.catenax.single_level_usage_as_built:3.0.0#SingleLevelUsageAsBuilt",
						"id": "urn:uuid:73dbae49-cba4-4f0e-bad4-3a2b3c05f9f4",
						"semanticId": {
							"keys": [
								{
									"value": "urn:samm:io.catenax.single_level_usage_as_built:3.0.0#SingleLevelUsageAsBuilt",
									"type": "GlobalReference"
								}
							],
							"type": "ExternalReference"
						},
						"endpoints": [
							{
								"protocolInformation": {
									"href": "https://trace-x-edc-int-a-dataplane.int.catena-x.net/api/public/urn:uuid:73dbae49-cba4-4f0e-bad4-3a2b3c05f9f4",
									"endpointProtocol": "HTTP",
									"endpointProtocolVersion": [
										"1.1"
									],
									"subprotocol": "DSP",
									"subprotocolBody": "id=urn:uuid:6e1270db-dc82-4019-9a23-4028a95ad214;dspEndpoint=https://trace-x-edc-int-a.int.catena-x.net",
									"subprotocolBodyEncoding": "plain",
									"securityAttributes": [
										{
											"type": "NONE",
											"key": "NONE",
											"value": "NONE"
										}
									]
								},
								"interface": "SUBMODEL-3.0"
							}
						]
					},
					{
						"administration": null,
						"description": [],
						"idShort": "urn:samm:io.catenax.serial_part:3.0.0#SerialPart",
						"id": "urn:uuid:46e38a9d-90e9-48a1-8bc8-f2b6b7bdf81a",
						"semanticId": {
							"keys": [
								{
									"value": "urn:samm:io.catenax.serial_part:3.0.0#SerialPart",
									"type": "GlobalReference"
								}
							],
							"type": "ExternalReference"
						},
						"endpoints": [
							{
								"protocolInformation": {
									"href": "https://trace-x-edc-int-a-dataplane.int.catena-x.net/api/public/urn:uuid:46e38a9d-90e9-48a1-8bc8-f2b6b7bdf81a",
									"endpointProtocol": "HTTP",
									"endpointProtocolVersion": [
										"1.1"
									],
									"subprotocol": "DSP",
									"subprotocolBody": "id=urn:uuid:6e1270db-dc82-4019-9a23-4028a95ad214;dspEndpoint=https://trace-x-edc-int-a.int.catena-x.net",
									"subprotocolBodyEncoding": "plain",
									"securityAttributes": [
										{
											"type": "NONE",
											"key": "NONE",
											"value": "NONE"
										}
									]
								},
								"interface": "SUBMODEL-3.0"
							}
						]
					}
				]
			}
		},
		{
			"contractAgreementId": "b2554bc7-fd85-4a05-b3d5-84109c054b6f",
			"payload": {
				"administration": null,
				"description": [],
				"globalAssetId": "urn:uuid:4a5e9ff6-2d5c-4510-a90e-d55af3ba502f",
				"idShort": "a/devDoorKey-3006e3fb72634f339dbafc1c019e9f71",
				"id": "urn:uuid:adb11d95-1990-4992-a125-0bbe254937f3",
				"specificAssetIds": [
					{
						"name": "manufacturerId",
						"subjectId": null,
						"externalSubjectId": {
							"keys": [
								{
									"value": "BPNL000000000UKM",
									"type": "GlobalReference"
								}
							],
							"type": "ExternalReference"
						},
						"value": "BPNL000000000UKM",
						"semanticId": null
					},
					{
						"name": "partInstanceId",
						"subjectId": null,
						"externalSubjectId": {
							"keys": [
								{
									"value": "BPNL000000000UKM",
									"type": "GlobalReference"
								}
							],
							"type": "ExternalReference"
						},
						"value": "NO-246880451848384868750731",
						"semanticId": null
					}
				],
				"submodelDescriptors": [
					{
						"administration": null,
						"description": [],
						"idShort": "urn:samm:io.catenax.serial_part:3.0.0#SerialPart",
						"id": "urn:uuid:843e269b-721e-4152-a5b2-9917b150060b",
						"semanticId": {
							"keys": [
								{
									"value": "urn:samm:io.catenax.serial_part:3.0.0#SerialPart",
									"type": "GlobalReference"
								}
							],
							"type": "ExternalReference"
						},
						"endpoints": [
							{
								"protocolInformation": {
									"href": "https://trace-x-edc-int-a-dataplane.int.catena-x.net/api/public/urn:uuid:843e269b-721e-4152-a5b2-9917b150060b",
									"endpointProtocol": "HTTP",
									"endpointProtocolVersion": [
										"1.1"
									],
									"subprotocol": "DSP",
									"subprotocolBody": "id=urn:uuid:6e1270db-dc82-4019-9a23-4028a95ad214;dspEndpoint=https://trace-x-edc-int-a.int.catena-x.net",
									"subprotocolBodyEncoding": "plain",
									"securityAttributes": [
										{
											"type": "NONE",
											"key": "NONE",
											"value": "NONE"
										}
									]
								},
								"interface": "SUBMODEL-3.0"
							}
						]
					},
					{
						"administration": null,
						"description": [],
						"idShort": "urn:samm:io.catenax.single_level_usage_as_built:3.0.0#SingleLevelUsageAsBuilt",
						"id": "urn:uuid:61214817-6a4b-425f-88f3-cf5cb2595a7c",
						"semanticId": {
							"keys": [
								{
									"value": "urn:samm:io.catenax.single_level_usage_as_built:3.0.0#SingleLevelUsageAsBuilt",
									"type": "GlobalReference"
								}
							],
							"type": "ExternalReference"
						},
						"endpoints": [
							{
								"protocolInformation": {
									"href": "https://trace-x-edc-int-a-dataplane.int.catena-x.net/api/public/urn:uuid:61214817-6a4b-425f-88f3-cf5cb2595a7c",
									"endpointProtocol": "HTTP",
									"endpointProtocolVersion": [
										"1.1"
									],
									"subprotocol": "DSP",
									"subprotocolBody": "id=urn:uuid:6e1270db-dc82-4019-9a23-4028a95ad214;dspEndpoint=https://trace-x-edc-int-a.int.catena-x.net",
									"subprotocolBodyEncoding": "plain",
									"securityAttributes": [
										{
											"type": "NONE",
											"key": "NONE",
											"value": "NONE"
										}
									]
								},
								"interface": "SUBMODEL-3.0"
							}
						]
					}
				]
			}
		}
	],
	"tombstones": [],
	"submodels": [
		{
			"identification": "urn:uuid:37c8183e-8ae2-4135-80fd-f6c82005ccd4",
			"aspectType": "urn:samm:io.catenax.single_level_bom_as_built:3.0.0#SingleLevelBomAsBuilt",
			"contractAgreementId": "dbfee03d-0563-4b4d-8438-c0d303fe19ab",
			"payload": {
				"catenaXId": "urn:uuid:f11ddc62-3bd5-468f-b7b0-110fe13ed0cd",
				"childItems": [
					{
						"quantity": {
							"value": 1,
							"unit": "unit:piece"
						},
						"createdOn": "2018-09-17T14:48:54.709Z",
						"lastModifiedOn": "2022-02-03T14:48:54.709Z",
						"catenaXId": "urn:uuid:4a5e9ff6-2d5c-4510-a90e-d55af3ba502f",
						"businessPartner": "BPNL000000000UKM",
						"hasAlternatives": false
					}
				]
			}
		},
		{
			"identification": "urn:uuid:46e38a9d-90e9-48a1-8bc8-f2b6b7bdf81a",
			"aspectType": "urn:samm:io.catenax.serial_part:3.0.0#SerialPart",
			"contractAgreementId": "dbfee03d-0563-4b4d-8438-c0d303fe19ab",
			"payload": {
				"localIdentifiers": [
					{
						"value": "BPNL000000000DWF",
						"key": "manufacturerId"
					},
					{
						"value": "NO-004314332935115065980115",
						"key": "partInstanceId"
					}
				],
				"manufacturingInformation": {
					"date": "2022-02-04T14:48:54Z",
					"country": "DEU"
				},
				"catenaXId": "urn:uuid:f11ddc62-3bd5-468f-b7b0-110fe13ed0cd",
				"partTypeInformation": {
					"manufacturerPartId": "9069675-60",
					"customerPartId": "9069675-60",
					"partClassification": [
						{
							"classificationStandard": "classificationStandard",
							"classificationID": "classificationID",
							"classificationDescription": "classificationDescription"
						}
					],
					"nameAtManufacturer": "b/test Door f-l",
					"nameAtCustomer": "Door front-left"
				}
			}
		},
		{
			"identification": "urn:uuid:843e269b-721e-4152-a5b2-9917b150060b",
			"aspectType": "urn:samm:io.catenax.serial_part:3.0.0#SerialPart",
			"contractAgreementId": "dbfee03d-0563-4b4d-8438-c0d303fe19ab",
			"payload": {
				"localIdentifiers": [
					{
						"value": "BPNL000000000UKM",
						"key": "manufacturerId"
					},
					{
						"value": "NO-246880451848384868750731",
						"key": "partInstanceId"
					}
				],
				"manufacturingInformation": {
					"date": "2022-02-04T14:48:54Z",
					"country": "DEU"
				},
				"catenaXId": "urn:uuid:4a5e9ff6-2d5c-4510-a90e-d55af3ba502f",
				"partTypeInformation": {
					"manufacturerPartId": "8770123-80",
					"customerPartId": "8770123-80",
					"partClassification": [
						{
							"classificationStandard": "classificationStandard",
							"classificationID": "classificationID",
							"classificationDescription": "classificationDescription"
						}
					],
					"nameAtManufacturer": "a/dev Door Key",
					"nameAtCustomer": "Door Key"
				}
			}
		}
	],
	"bpns": []
}

Since there is no relationship object in the reponse, I'll guess that we map this automatically as an OWN part.
You can reproduce that by synching any Customer/Supplier Part (only one part) and wait for the successuful synchronization.

We should either block the synchronization of Supplier/Customer parts or find out the corresponding OWN Part and synch that instead.

@ds-lcapellino ds-lcapellino moved this from wip to next in Trace-X Aug 1, 2024
@ds-mwesener ds-mwesener removed the R24.8 label Aug 2, 2024
@mkanal mkanal moved this from next to backlog in Trace-X Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: backlog
Development

No branches or pull requests

3 participants