hilla icon indicating copy to clipboard operation
hilla copied to clipboard

Connection lost indication for cancelled requests

Open platosha opened this issue 9 months ago • 1 comments

Describe the bug

After an endpoint request is cancelled programmatically using AbortController.abort(reason), the builtin Vaadin connection indicator erroneously shows ”Connection lost” status.

Note: aborting without a specific reason works correctly.

Expected Behavior

Cancelling an endpoint request manually should not affect the connection indicator status.

Detecting and handling signal.reason should help.

From the loading indicator, an aborted request should be considered finished successfully.

Reproduction

const abortController = new AbortController();
MyService.myEndpoint({signal: abortController.signal});
abortController.abort('no!');

System Info

Vaadin 24.6

platosha avatar Feb 24 '25 14:02 platosha

I tried to reproduce in both Chrome and Firefox, but unsuccessfully. By the way, AbortController has no cancel method, it's abort. I tried with both an endpoint method that returns immediately and one that takes time so that the cancellation happens.

cromoteca avatar Feb 25 '25 10:02 cromoteca