hocuspocus icon indicating copy to clipboard operation
hocuspocus copied to clipboard

No way to access connection rejection promise when auto retry after disconnect in provider

Open deeg opened this issue 2 years ago • 2 comments

Description When Provider tries re-connecting after a disconnection, if there is an error connecting and max tries are reached, no programatic way to tell this is finished and take additional action.

The rejection promise is not being handled or sent outside of the provider in anyway.

Steps to reproduce the bug Steps to reproduce the behavior:

  1. Be using HP Provider
  2. Go offline (Turn WIFI off)
  3. Come back online (Turn WIFI on)
  4. HP Provider tries to re-connect
  5. After max amount rejection promise is swallowed and user not able to determine retry is over

Expected behavior There is some how access to promise rejection of connect so user knows when retries are over and can take additional action

Screenshot, video, or GIF This is the code where connect is called and rejection promise not handled: https://github.com/ueberdosis/hocuspocus/blob/476898bfb892227ea9fbd18433e01e9717b9d549/packages/provider/src/HocuspocusProvider.ts#L616

Environment?

  • operating system: Mac
  • browser: Chrome
  • mobile/desktop: Desktop
  • hocuspocus version: Provider 1.0.0

deeg avatar Mar 15 '23 15:03 deeg

Hello,

I was wondering if this issue has been resolved or if there are any updates regarding it. If not, are there any workarounds available?

Thank you for your time and help!

iyk2h avatar Dec 20 '24 02:12 iyk2h

Hello,

I was wondering if this issue has been resolved or if there are any updates regarding it. If not, are there any workarounds available?

Thank you for your time and help!

I stucked this issue in iOS15/iOS16. TL;DR: setInterval or setTimeout was unreliable in iOS15/iOS16 webkit, i use requestAnimationFrame which wrapper by @essentials/request-interval or @essentials/request-timeout' to replace it.

you can refer this issue for more detail: https://github.com/ueberdosis/hocuspocus/issues/661#issuecomment-1659529653

grootgordon avatar May 09 '25 03:05 grootgordon