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

[ML Bulk] Invalid timestamp scenario not shown as failed transaction #2801

Closed
3 of 7 tasks
elnyry-sam-k opened this issue Jul 1, 2022 · 1 comment
Closed
3 of 7 tasks
Assignees
Labels
bug Something isn't working or it has wrong behavior on a Mojaloop Core service core-dev-squad oss-bulk Mojaloop bulk implementation and support oss-core This is an issue - story or epic related to a feature on a Mojaloop core service or related to it

Comments

@elnyry-sam-k
Copy link
Member

elnyry-sam-k commented Jul 1, 2022

Summary:
When executing tests in TTK for the timeout scenario noticed that after applying an invalid timestamp to a bulktransfer PUT response, there was no callback or error message

Severity:
Medium

Priority:
Critical

Expected Behavior:

  • The transfer is aborted and logged
  • Synchronous error should be limited to schema validation (200 for PUT), business logic, validation should happen in (bulk) fulfil handler
  • Payer FSP sent an error callback on /bulkTransfers/{ID}/error

Steps to Reproduce
This is the curl PUT Bulktransfer request that contains an invalid timestamp
noresponsepayeefsp → PUT request--> testingtoolkitdfsp

curl 'http://moja-bulk-api-adapter-service/bulkTransfers/6fb43af4-3419-4a23-b30f-1c743e118907' -X PUT -H 'content-type: application/vnd.interoperability.bulkTransfers+json;version=1.0' -H 'date: Fri, 24 Jun 2022 03:09:41 GMT' -H 'fspiop-source: noresponsepayeefsp' -H 'fspiop-destination: testingtoolkitdfsp' -H 'traceparent: 00-aabb7de40f9dbc9d82e5b5807feb81fe-0123456789abcdef0-00' -H 'user-agent: axios/0.21.4' 
--data-binary 
'{
"bulkTransferState":"COMPLETED",
"completedTimestamp":"2022-06-24T03:09:51.307Z",
"individualTransferResults":[{"transferId":"4f391003-ffb6-4ca6-9790-389fc2243afa","fulfilment":"UNlJ98hZTY_dsw0cAqw4i_UN3v4utt7CZFB4yfLbVFA"},{"transferId":"181336dd-ab57-45aa-b064-b0acf249344e","fulfilment":"UNlJ98hZTY_dsw0cAqw4i_UN3v4utt7CZFB4yfLbVFA"}]}' --compressed

This is the response for the PUT request from above

{
  "status": 400,
  "statusText": "Bad Request",
  "body": {
    "errorCode": 400,
    "errorDescription": "Bad Request",
    "extensionList": {
      "extension": [
        {
          "key": "customValidationError",
          "value": "completedTimestamp fails because future timestamp was provided"
        }
      ]
    }
  },
  "headers": {
    "content-type": "application/json; charset=utf-8",
    "vary": "origin",
    "access-control-expose-headers": "WWW-Authenticate,Server-Authorization",
    "cache-control": "no-cache",
    "content-length": "187",
    "date": "Fri, 24 Jun 2022 03:09:41 GMT",
    "connection": "keep-alive"
  }
}

Now we can try to validate the status for the transfer by using GET /bulkTransfers . This is the response for the GET /bulkTransfers.

{
  "url": "put /bulkTransfers/6fb43af4-3419-4a23-b30f-1c743e118907",
  "headers": {
    "content-type": "application/vnd.interoperability.bulkTransfers+json;version=1.1",
    "date": "Fri, 24 Jun 2022 03:09:41 GMT",
    "fspiop-source": "switch",
    "fspiop-destination": "testingtoolkitdfsp",
    "traceparent": "00-aabb7de40f9dbc9d82e5b5807feb81fe-0123456789abcdef0-00",
    "user-agent": "axios/0.21.4",
    "connection": "keep-alive",
    "fspiop-http-method": "PUT",
    "fspiop-uri": "/testingtoolkitdfsp/bulkTransfers/6fb43af4-3419-4a23-b30f-1c743e118907",
    "content-length": "2550",
    "host": "moja-ml-testing-toolkit-backend:5000"
  },
  "body": {
    "bulkTransferState": "ACCEPTED",
    "individualTransferResults": [
      {
        "transferId": "4f391003-ffb6-4ca6-9790-389fc2243afa",
        "transferAmount": {
          "amount": "1",
          "currency": "EUR"
        },
        "ilpPacket": "AYIC9AAAAAAAABdwHWcucGF5ZWVmc3AubXNpc2RuLjIyNTU2OTk5MTI1ggLKZXlKMGNtRnVjMkZqZEdsdmJrbGtJam9pWmpRMFltUmtOV010WXpreE1DMDBZVGt3TFRoa05qa3RaR0ppWVRaaVl6aGxZVFpqSWl3aWNYVnZkR1ZKWkNJNklqVTBaRFZtTURsaUxXRTBOMlF0TkRCa05pMWhZVEEzTFdFNVkyWXpZbUl5TkRsaFpDSXNJbkJoZVdWbElqcDdJbkJoY25SNVNXUkpibVp2SWpwN0luQmhjblI1U1dSVWVYQmxJam9pVFZOSlUwUk9JaXdpY0dGeWRIbEpaR1Z1ZEdsbWFXVnlJam9pTWpJMU5UWTVPVGt4TWpVaUxDSm1jM0JKWkNJNkluQmhlV1ZsWm5Od0luMTlMQ0p3WVhsbGNpSTZleUp3WVhKMGVVbGtTVzVtYnlJNmV5SndZWEowZVVsa1ZIbHdaU0k2SWsxVFNWTkVUaUlzSW5CaGNuUjVTV1JsYm5ScFptbGxjaUk2SWpJeU5UQTNNREE0TVRneElpd2labk53U1dRaU9pSndZWGxsY21aemNDSjlMQ0p3WlhKemIyNWhiRWx1Wm04aU9uc2lZMjl0Y0d4bGVFNWhiV1VpT25zaVptbHljM1JPWVcxbElqb2lUV0YwY3lJc0lteGhjM1JPWVcxbElqb2lTR0ZuYldGdUluMHNJbVJoZEdWUFprSnBjblJvSWpvaU1UazRNeTB4TUMweU5TSjlmU3dpWVcxdmRXNTBJanA3SW1GdGIzVnVkQ0k2SWpZd0lpd2lZM1Z5Y21WdVkza2lPaUpWVTBRaWZTd2lkSEpoYm5OaFkzUnBiMjVVZVhCbElqcDdJbk5qWlc1aGNtbHZJam9pVkZKQlRsTkdSVklpTENKcGJtbDBhV0YwYjNJaU9pSlFRVmxGVWlJc0ltbHVhWFJwWVhSdmNsUjVjR1VpT2lKRFQwNVRWVTFGVWlKOWZRAA",
        "condition": "kPLCKM62VY2jbekuw3apCTBg5zk_mVs9DD8-XpljQms",
        "extensionList": {
          "extension": [
            {
              "key": "extKey1",
              "value": "extValue1"
            },
            {
              "key": "extKey2",
              "value": "extValue2"
            }
          ]
        }
      },
      {
        "transferId": "181336dd-ab57-45aa-b064-b0acf249344e",
        "transferAmount": {
          "amount": "2",
          "currency": "GBP"
        },
        "ilpPacket": "AYIC9AAAAAAAABdwHWcucGF5ZWVmc3AubXNpc2RuLjIyNTU2OTk5MTI1ggLKZXlKMGNtRnVjMkZqZEdsdmJrbGtJam9pWmpRMFltUmtOV010WXpreE1DMDBZVGt3TFRoa05qa3RaR0ppWVRaaVl6aGxZVFpqSWl3aWNYVnZkR1ZKWkNJNklqVTBaRFZtTURsaUxXRTBOMlF0TkRCa05pMWhZVEEzTFdFNVkyWXpZbUl5TkRsaFpDSXNJbkJoZVdWbElqcDdJbkJoY25SNVNXUkpibVp2SWpwN0luQmhjblI1U1dSVWVYQmxJam9pVFZOSlUwUk9JaXdpY0dGeWRIbEpaR1Z1ZEdsbWFXVnlJam9pTWpJMU5UWTVPVGt4TWpVaUxDSm1jM0JKWkNJNkluQmhlV1ZsWm5Od0luMTlMQ0p3WVhsbGNpSTZleUp3WVhKMGVVbGtTVzVtYnlJNmV5SndZWEowZVVsa1ZIbHdaU0k2SWsxVFNWTkVUaUlzSW5CaGNuUjVTV1JsYm5ScFptbGxjaUk2SWpJeU5UQTNNREE0TVRneElpd2labk53U1dRaU9pSndZWGxsY21aemNDSjlMQ0p3WlhKemIyNWhiRWx1Wm04aU9uc2lZMjl0Y0d4bGVFNWhiV1VpT25zaVptbHljM1JPWVcxbElqb2lUV0YwY3lJc0lteGhjM1JPWVcxbElqb2lTR0ZuYldGdUluMHNJbVJoZEdWUFprSnBjblJvSWpvaU1UazRNeTB4TUMweU5TSjlmU3dpWVcxdmRXNTBJanA3SW1GdGIzVnVkQ0k2SWpZd0lpd2lZM1Z5Y21WdVkza2lPaUpWVTBRaWZTd2lkSEpoYm5OaFkzUnBiMjVVZVhCbElqcDdJbk5qWlc1aGNtbHZJam9pVkZKQlRsTkdSVklpTENKcGJtbDBhV0YwYjNJaU9pSlFRVmxGVWlJc0ltbHVhWFJwWVhSdmNsUjVjR1VpT2lKRFQwNVRWVTFGVWlKOWZRAA",
        "condition": "kPLCKM62VY2jbekuw3apCTBg5zk_mVs9DD8-XpljQms"
      }
    ]
  }
}

Specifications

  • Component (if known): Bulk services
  • Version: Mojaloop v13.1.1
  • Platform: AWS
  • Subsystem: bulk processing (bulk fulfil / bulk processing / bulk timeout)
  • Type of testing: Functional
  • Bug found/raised by: Emerson P

Notes:

  • Severity when opened: Medium
  • Priority when opened: Critical

timeout-error-alone-bulktransfer.txt

Tasks:

  • Timestamp validation in bulk-fulfil handler for PUT /bulkTransfers/{ID} calls
  • Error callback to be sent to FSPs on errors
  • Bulk transfer to be aborted for validation failures for root-level fields
  • TTK test cases
@elnyry-sam-k elnyry-sam-k added oss-core This is an issue - story or epic related to a feature on a Mojaloop core service or related to it bug Something isn't working or it has wrong behavior on a Mojaloop Core service oss-bulk Mojaloop bulk implementation and support core-dev-squad labels Jul 1, 2022
@elnyry-sam-k
Copy link
Member Author

Need to log a new bug for bulk transfers time-out handling behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or it has wrong behavior on a Mojaloop Core service core-dev-squad oss-bulk Mojaloop bulk implementation and support oss-core This is an issue - story or epic related to a feature on a Mojaloop core service or related to it
Projects
None yet
Development

No branches or pull requests

2 participants