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] Duplicated error messages #1188

Closed
ds-crehm opened this issue Jul 8, 2024 · 9 comments · Fixed by #1210
Closed

[BUG] Duplicated error messages #1188

ds-crehm opened this issue Jul 8, 2024 · 9 comments · Fixed by #1210
Assignees
Labels
bug Something isn't working frontend Frontend related Issues

Comments

@ds-crehm
Copy link
Contributor

ds-crehm commented Jul 8, 2024

Links

Description

Whenever an error happens during the sending of a notification, a duplicated error message is created. This does not happen for successful messages.

Current behaviour

Image
{ "id": 1, "title": "POLICY TEST", "status": "SENT", "description": "INVALID POLICY TEST", "createdBy": "BPNL00000003CML1", "createdByName": null, "createdDate": "2024-07-08T12:10:39.756187Z", "updatedDate": "2024-07-08T12:31:01.799274Z", "assetIds": [ "urn:uuid:7eeeac86-7b69-444d-81e6-655d0f1513bd" ], "channel": "SENDER", "sendTo": "BPNL00000003CNKC", "sendToName": null, "severity": "MINOR", "type": "INVESTIGATION", "targetDate": null, "messages": [ { "id": "c27b5520-d92a-4463-bb1c-e148ccf9f463", "sentBy": "BPNL00000003CML1", "sentByName": null, "sendTo": "BPNL00000003CNKC", "sendToName": null, "contractAgreementId": null, "notificationReferenceId": null, "edcNotificationId": "c27b5520-d92a-4463-bb1c-e148ccf9f463", "messageDate": "2024-07-08T12:10:48.260850", "messageId": "334f51d6-0859-47bd-8b8a-87091b4d07af", "status": "SENT", "errorMessage": "Failed to negotiate contract agreement: Policies [INVALID_POLICY_TEST] did not match with policy from BPNL00000003CNKC.", "message": null }, { "id": "01c8b491-af0f-4701-8689-ccdeea465c0d", "sentBy": "BPNL00000003CML1", "sentByName": null, "sendTo": "BPNL00000003CNKC", "sendToName": null, "contractAgreementId": null, "notificationReferenceId": null, "edcNotificationId": "01c8b491-af0f-4701-8689-ccdeea465c0d", "messageDate": "2024-07-08T12:10:52.145857", "messageId": "54a64fc5-7a76-4bf4-a068-4c2e4c988d2f", "status": "SENT", "errorMessage": "Failed to negotiate contract agreement: Policies [INVALID_POLICY_TEST] did not match with policy from BPNL00000003CNKC.", "message": null }, { "id": "5ef8ccc2-5571-4303-ad76-c3eb0f03e29b", "sentBy": "BPNL00000003CML1", "sentByName": null, "sendTo": "BPNL00000003CNKC", "sendToName": null, "contractAgreementId": null, "notificationReferenceId": null, "edcNotificationId": "5ef8ccc2-5571-4303-ad76-c3eb0f03e29b", "messageDate": "2024-07-08T12:22:44.157571", "messageId": "f4ef9aff-2a0a-49f6-81da-8123a9d4be8d", "status": "SENT", "errorMessage": "Failed to negotiate contract agreement: Policy from BPNL00000003CNKC has expired.", "message": null }, { "id": "51fbfc66-f5e8-409f-a39b-405c5a84cdd2", "sentBy": "BPNL00000003CML1", "sentByName": null, "sendTo": "BPNL00000003CNKC", "sendToName": null, "contractAgreementId": null, "notificationReferenceId": null, "edcNotificationId": "51fbfc66-f5e8-409f-a39b-405c5a84cdd2", "messageDate": "2024-07-08T12:22:47.724387", "messageId": "519b8f4b-1dff-4a1c-b689-fcd6fe42fe11", "status": "SENT", "errorMessage": "Failed to negotiate contract agreement: Policy from BPNL00000003CNKC has expired.", "message": null }, { "id": "828076e8-7408-4c6b-923e-a6251cf8a661", "sentBy": "BPNL00000003CML1", "sentByName": null, "sendTo": "BPNL00000003CNKC", "sendToName": null, "contractAgreementId": "dbdb35aa-9ec9-4a35-844a-7cc2a6784f65", "notificationReferenceId": null, "edcNotificationId": "828076e8-7408-4c6b-923e-a6251cf8a661", "messageDate": "2024-07-08T12:30:48.207708", "messageId": "1b05eeea-9940-4daa-b7bf-4714c973697e", "status": "SENT", "errorMessage": null, "message": null } ] }

Expected behavior

Only one error message is created.

Steps to reproduce the Bug

  1. Create alert with wrong BPN (e.g. BPNL00000003CNKD)
  2. Approve alert
  3. Go to detail view of alert
@ds-crehm ds-crehm added bug Something isn't working backend Backend related issues labels Jul 8, 2024
@ds-lcapellino ds-lcapellino added frontend Frontend related Issues and removed backend Backend related issues labels Jul 11, 2024
@ds-lcapellino
Copy link
Contributor

There is a second call triggered to /approve, in case of errors:

Image

@ds-mwesener
Copy link
Contributor

Hi @ds-mmaul please see image of lucas. It seems like frontend is triggering two calls.

ds-mwesener added a commit that referenced this issue Jul 12, 2024
…-notification-message-fix

Chore/#1188 duplicated notification message fix
@ds-crehm
Copy link
Contributor Author

ds-crehm commented Jul 12, 2024

Tested on E2E:
Only one error message is created in the backend and shown in the frontend:
image
image
image

Ready for review

@ds-crehm ds-crehm reopened this Jul 12, 2024
@ds-crehm ds-crehm assigned mkanal and unassigned ds-mmaul and ds-crehm Jul 12, 2024
@mkanal
Copy link
Contributor

mkanal commented Jul 18, 2024

#1234
Now no message is created right now.

@ds-lcapellino @ds-mwesener

@mkanal mkanal assigned ds-crehm and unassigned mkanal Jul 18, 2024
@mkanal
Copy link
Contributor

mkanal commented Jul 18, 2024

@ds-crehm please retest

@ds-crehm
Copy link
Contributor Author

@mkanal replicating the exact process from the bug ticket does create the error message like expected for me. My assumption is that the state of Trace-X at the time was the cause for those issues.
Since a bug ticket is already created and I the acceptance criteria of this ticket are met I will move it back to review.

@ds-crehm ds-crehm assigned mkanal and unassigned ds-crehm Jul 19, 2024
@mkanal
Copy link
Contributor

mkanal commented Jul 22, 2024

@ds-crehm

There is no error. I have tested it again on e2e. https://traceability-portal-e2e-a.dev.demo.catena-x.net/inbox/237 Error situation seems to be resolved. This is a bug and it is related to the resolution of this ticket. So I will move the ticket back to wip.

image

@ds-crehm
Copy link
Contributor Author

ds-crehm commented Jul 23, 2024

One situation where this happens is when a notification was edited and the senderBPN changed: #1122
That is a situation that may never occur normally and in that situation the message creation process is never reached as this problem already happens before that. That's why there's nothing in the message history.
The situation from your screenshot is the same situation. A notification on a tombstone cannot be sent right now. So the message creation process is never reached and no error message is created. For this I created another ticket: #1270

Since both of these things are unrelated to the duplication of error messages and that specific issue is resolved, I will move this ticket again to review.

@mkanal
Copy link
Contributor

mkanal commented Jul 23, 2024

LGFM. PO Acceptance in behalf of @jzbmw .

@mkanal mkanal closed this as completed Jul 23, 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 frontend Frontend related Issues
Projects
Status: done
Development

Successfully merging a pull request may close this issue.

5 participants