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

request module puts all extensions under cause key and breaks Account Lookup Service expectations #1262

Closed
vbarzokas opened this issue Mar 13, 2020 · 1 comment
Assignees
Milestone

Comments

@vbarzokas
Copy link
Member

Summary:
The central-services-shared/src/util/request.js module puts all extensions under cause key and breaks Account Lookup Service expectations. It does this here and more specifically:

const cause = JSON.stringify(extensionArray)
const fspiopError = ErrorHandler.Factory.createFSPIOPError(ErrorHandler.Enums.FSPIOPErrorCodes.DESTINATION_COMMUNICATION_ERROR, 'Failed to send HTTP request to host', error, source, [{ key: 'cause', value: cause }])

The ALS in this block of code expects that there will be an extension list and it will contain the key status in the path extensionList.extensions[] and more specifically:

err.extensions.some(ext => (ext.key === 'status' && (ext.value === Enums.Http.ReturnCodes.BADREQUEST.CODE || ext.value === Enums.Http.ReturnCodes.NOTFOUND.CODE)))

This is currently blocking the Mowali implementation from proceeding further.

Severity:
High

Priority:
Critical

Expected Behavior
The keys put inside the array extensionList.extensions should be accessible by the Account Lookup Service and more specifically the status key.

Steps to Reproduce

  1. Make sure that the payee FSP is down/not reachable.
  2. Make a request to GET /parties/MSISDN/27634485971 which corresponds to the mentioned payee FSP
  3. Inspect the logs of the Account Lookup Service. You will notice something like that which breaks the expectations mentioned above, because all the extensions are under the cause key.
    ... "extensionList":{"extension":[{"key":"cause","value":"[{\"key\":\"url\",\"value\":\"http://mowbkd-als-oracle-pathfinder/participants/MSISDN/27634485971\"},{\"key\":\"sourceFsp\",\"value\":\"testfsp"}]}} ...

Specifications

  • Component (if known): central-services-shared
  • Version: 9.3.2
  • Platform:
  • Subsystem:
  • Type of testing:
  • Bug found/raised by: @vbarzokas

Notes:

  • Severity when opened: High
  • Priority when opened: Critical
@elnyry-sam-k elnyry-sam-k added this to the Sprint 9.4 milestone Mar 16, 2020
rmothilal added a commit to rmothilal/account-lookup-service that referenced this issue Mar 16, 2020
rmothilal added a commit to mojaloop/account-lookup-service that referenced this issue Mar 16, 2020
* Initial Commit.

* Upload domain/participant test.

* Upload domain/participant test.

* fixes for getParticipantsByTypeId test failing. now functioning properly
removed validator file as it isn't used may be required in MSISDN oracle as it validated mobile number formats

* Checking in testing code.

* removal of vscode config

* updated gitignore

* fixes for stubbing issues

* fix for bug mojaloop/project#797
Fixes for sonarQube code sanity i.e removing function names that aren't needed, changing let to const, reordering functions in file
Changed unique constraint on oracleEndpoint which is now working correctly

* fix for only retrieving default entries
return undefined for currency when it is not available

* fix for returning null for valid oracle lookup

* correct database port

* removal of isOracle for header validation

* fix for incorrect endpoint being requested for callback response

* updated with pre-commit to manage dependencies

* Updated versions of ALS dependencies and updated standard changes

* incorrect port for database being set

* Updated to latest central-services-shared library for issue mojaloop/project#1262

Co-authored-by: Henk Kodde <henk.kodde@modusbox.com>
@vbarzokas
Copy link
Member Author

Issue has been addressed with the referenced commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants