Skip to content

Commit

Permalink
fix: Promises in Tree subscriptions should reject if aborted (#6616)
Browse files Browse the repository at this point in the history
Noticed this bug when backporting the original fix. This fix rejects
(instead of resolves) the initial view call when aborted, and correctly
passes the failure off to the callback to drive the next outer promise.

Follow-up #6591
  • Loading branch information
niloc132 authored Feb 3, 2025
1 parent a3b00c2 commit 0dcea7a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ private TicketAndPromise<ClientTableState> makeView(TicketAndPromise<?> prevTick
viewRequest.setResultViewId(ticket);
keyTable.then(t -> {
if (controller.signal.aborted) {
return Promise.resolve(controller.signal.reason);
return Promise.reject(controller.signal.reason);
}
if (keyTableData[0].length > 0) {
HierarchicalTableViewKeyTableDescriptor expansions = new HierarchicalTableViewKeyTableDescriptor();
Expand All @@ -382,7 +382,7 @@ private TicketAndPromise<ClientTableState> makeView(TicketAndPromise<?> prevTick
connection.hierarchicalTableServiceClient().view(viewRequest, connection.metadata(), c::apply);
controller.signal.addEventListener("abort", e -> viewCreationCall.cancel());
return null;
}, error -> {
}).catch_(error -> {
c.apply(error, null);
return null;
});
Expand Down

0 comments on commit 0dcea7a

Please sign in to comment.