mojaloop / project

Repo to track product development issues for the Mojaloop project.
Other
22 stars 15 forks source link

[central-services-shared] Cache implementation sometimes not populating `value` field #3843

Open kleyow opened 2 months ago

kleyow commented 2 months ago

Summary: Intermittedly on a cache miss the value returned from the cache implementation is undefined. This is a weird edge case or bug because value should never be undefined, fetchParticipant should be called and value should be populated.

If fetchParticipant failed that should be an error object and the code would rethrow participant not found, server error, etc.

Severity: (Low, Medium, High)

Priority: (Critical, Medium, Low)

Expected Behavior

value should always be defined, but barring a fix, adding in a conditional to throw a proper error instead of a type error.

Steps to Reproduce

  1. Undetermined

Specifications

Notes:

ml-core-test-harness with ALS v15.2.3 when running GP after onboarding, rarely happens.

image_720.png

<img width="720" src="https:image.png //api.zenhub.com/attachedFiles/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBNnhCQkE9PSIsImV4cCI6bnVsbCwicHVyIjoiYmxvYl9pZCJ9fQ==--b285227cb8e8beafc341d70c9ba11e8366fda778/image_720.png" alt="image_720.png" />

"TypeError: Cannot read properties of undefined (reading 'errorInformation')\n    at exports.getParticipant (/opt/app/node_modules/@mojaloop/central-services-shared/src/util/participants.js:130:21)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async exports.validateParticipant (/opt/app/src/models/participantEndpoint/facade.js:135:18)\n    at async Object.postParticipants (/opt/app/src/domain/participants/participants.js:285:41)"