mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
fix: disallow two pending requests with the same id (#1628)
* only increment nextId if id used * throw error if promise already pending with id * add test * modify existing tests * fix bug + tests
This commit is contained in:
@@ -180,6 +180,16 @@ export default function createMockRippled(port: number): MockedWebSocketServer {
|
||||
)
|
||||
} else if (request.data.closeServer) {
|
||||
conn.close()
|
||||
} else if (request.data.delayedResponseIn) {
|
||||
setTimeout(() => {
|
||||
conn.send(
|
||||
createResponse(request, {
|
||||
status: 'success',
|
||||
type: 'response',
|
||||
result: {},
|
||||
}),
|
||||
)
|
||||
}, request.data.delayedResponseIn)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user