Fix potential race condition in OrderCacheService
Opened this issue · 0 comments
MikeLuDev commented
Describe the bug
Context:
markets_1 | TypeError: Cannot read properties of undefined (reading 'get')
markets_1 | at OrderCacheService.updateOrder (/usr/app/node_modules/@staratlas/factory/src/marketplace/services/OrderCacheService.ts:169:41)
markets_1 | at GmOrderbookService.updateOrderInCache (/usr/app/node_modules/@staratlas/factory/src/marketplace/services/GmOrderbookService.ts:192:35)
markets_1 | at GmOrderbookService.handleOrderModifiedEvent (/usr/app/node_modules/@staratlas/factory/src/marketplace/services/GmOrderbookService.ts:303:10)
markets_1 | at GmOrderbookService.handleMarketplaceEvent (/usr/app/node_modules/@staratlas/factory/src/marketplace/services/GmOrderbookService.ts:320:14)
markets_1 | at GmEventService.handleOrderExchanged (/usr/app/node_modules/@staratlas/factory/src/marketplace/services/GmEventService.ts:161:10)
markets_1 | at /usr/app/node_modules/@project-serum/anchor/src/program/event.ts:110:17
markets_1 | at Array.forEach (<anonymous>)
markets_1 | at /usr/app/node_modules/@project-serum/anchor/src/program/event.ts:106:26
markets_1 | at EventParser.parseLogs (/usr/app/node_modules/@project-serum/anchor/src/program/event.ts:182:9)
markets_1 | at /usr/app/node_modules/@project-serum/anchor/src/program/event.ts:103:27
To Reproduce
- Attempt to update an
order
which doesn't already exist in the cache service
Expected behavior
- This should be gracefully handled