onAutoreconnectIteration issues

11 views
Skip to first unread message

Kain Bryan-Jones

unread,
Nov 7, 2025, 5:36:13 AM (3 days ago) Nov 7
to Tinode General
We have an app written and we have our own onConnect handling. We have the following code...
carbon.png We wanted to write custom logic for auto-reconnection, but we found that Tinode has its
own so we made a suboptimal hack with the above code which overrides the iteration timeout.

This has worked pretty much always until recently we had an issue. We had some network fluctuations and encountered the following log "onAutoreconnectIteration will retry in 4774.516907270728 ms"
and it never retries. I have looked into the source code and can't find a reason why onAutoreconnectIteration would just stop?
Can somebody help with this? Is there a max retry? Also is there a better way to handle this? Thank you.

Gene

unread,
Nov 7, 2025, 10:17:16 AM (3 days ago) Nov 7
to Tinode General
You can change this line https://github.com/tinode/tinode-js/blob/47299d3f8ee0cb98c3f09489d6de6be704eed62b/src/connection.js#L26 to 
const _BOFF_MAX_ITER = 2;
Then you can remove your code.

Gene

unread,
Nov 7, 2025, 10:39:19 AM (3 days ago) Nov 7
to Tinode General
BTW, unless you are dealing with automatic messaging (non-interactive), then you should not set it to 8 seconds. It's going to eat the battery on mobile.
Reply all
Reply to author
Forward
0 new messages