Merge pull request #959 from bbassie/feature/forwarded-request-cleanup

Forget a forwarded request that could not be sent
This commit is contained in:
Cooldude2606 authored and GitHub committed 2026-08-08 23:34:19 +01:00
commit bdf5e3011f
2 files changed
+51 -2

No files matched your search

+9 -2
View File
@@ -566,8 +566,15 @@ export class Link {
src: message.src,
dst: message.dst,
};
this._forwardedRequests.set(message.src.requestIndex(), pending);
this.connector.forward(message);
const requestIndex = message.src.requestIndex();
this._forwardedRequests.set(requestIndex, pending);
try {
this.connector.forward(message);
} catch (err) {
// Clean up pending request as there will be no response
this._forwardedRequests.delete(requestIndex);
throw err;
}
}
sendEvent<T>(event: Event<T>, dst: libData.Address) {