Should we resubsctibe on topics each time?

65 views
Skip to first unread message

Maxim

unread,
Apr 15, 2022, 6:21:50 AM4/15/22
to Tinode General
Hi, guys!
Should we resubscribe on each topic by user when we connect, or reconnect to tinode? 
Some users have many topics and subscribe process pass very painful. Looks like we did something wrong?

Gene

unread,
Apr 15, 2022, 9:36:12 PM4/15/22
to Tinode General
There is no need to attach to all the topics all the time. You are expected to attach to those topics where you read or publish messages. You are only expected to attach to 'me' topic all the time.

Maxim

unread,
Apr 18, 2022, 9:01:33 AM4/18/22
to Tinode General
But If I attach not to topics,  I can't receive any messages?

суббота, 16 апреля 2022 г. в 06:36:12 UTC+5, Gene:

Maxim

unread,
Apr 18, 2022, 9:25:02 AM4/18/22
to Tinode General
Maybe we can use query language to attach to all relevant topics by batch request?

понедельник, 18 апреля 2022 г. в 18:01:33 UTC+5, Maxim:

Maxim

unread,
Apr 18, 2022, 10:05:49 AM4/18/22
to Tinode General

I found it is attaching session operation. So for example we have 100500 grp topic on some a user. When user authenticate on backend, he resubscribes to all topics again (attaching), and should do it for each session active? 
понедельник, 18 апреля 2022 г. в 18:25:02 UTC+5, Maxim:

Gene

unread,
Apr 18, 2022, 11:24:16 AM4/18/22
to Tinode General
1. Always attach to 'me' topic. 'me' will inform you when there are new messages in any other topic.
2. Once you know which topic has messages, attach to it and read them. Also attach to topic when you want to send a message.

Maxim

unread,
Apr 18, 2022, 11:49:11 AM4/18/22
to Tinode General
Ok. Thanks. 
But, if topic have not new messages, should I attach to it to receive new messages while I connected to topic me in future? or we receive messages by topic 'me'?

понедельник, 18 апреля 2022 г. в 20:24:16 UTC+5, Gene:

Maxim

unread,
Apr 18, 2022, 3:06:41 PM4/18/22
to Tinode General
If I correct understand you we should:
1. attach to topic "me";
2. listen it and when we receive new message;
3. attach to topic and read it;
4 after read should we detach from it?


понедельник, 18 апреля 2022 г. в 20:49:11 UTC+5, Maxim:

Gene Sokolov

unread,
Apr 18, 2022, 3:11:04 PM4/18/22
to tin...@googlegroups.com
On Mon, Apr 18, 2022, 14:06 Maxim <bim...@gmail.com> wrote:
If I correct understand you we should:
1. attach to topic "me";
2. listen it and when we receive new message;
3. attach to topic and read it;

Yes

4 after read should we detach from it?

Yes, unless you want to respond.

--
You received this message because you are subscribed to a topic in the Google Groups "Tinode General" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tinode/Jo-mwCCarO0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tinode+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tinode/8a42afd8-b848-44bc-92b3-00a1a2a61954n%40googlegroups.com.

Maxim

unread,
Apr 18, 2022, 10:59:01 PM4/18/22
to Tinode General

Thank you, Gane! 
I'll do this logic, it looks more correct than our current implementation.
вторник, 19 апреля 2022 г. в 00:11:04 UTC+5, Gene:

Maxim

unread,
Apr 20, 2022, 10:06:35 AM4/20/22
to Tinode General
Gene, what will happen if user launch app first time, but has 100500 topics. If attach to topic 'me' we will receive only first 1024 topics? Should we paginate this request?

вторник, 19 апреля 2022 г. в 07:59:01 UTC+5, Maxim:

Gene Sokolov

unread,
Apr 20, 2022, 10:08:43 AM4/20/22
to tin...@googlegroups.com


On Wed, Apr 20, 2022, 09:06 Maxim <bim...@gmail.com> wrote:
Gene, what will happen if user launch app first time, but has 100500 topics. If attach to topic 'me' we will receive only first 1024 topics?

Yes. It will receive it as many as you configure on the server.

Should we paginate this request?

Yes

You received this message because you are subscribed to the Google Groups "Tinode General" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tinode+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tinode/4790e0f4-8f7e-476d-b7c6-74f7aac82c2dn%40googlegroups.com.

Maxim

unread,
Apr 20, 2022, 10:15:11 AM4/20/22
to Tinode General
Thank you!

среда, 20 апреля 2022 г. в 19:08:43 UTC+5, Gene:
Reply all
Reply to author
Forward
0 new messages