Back

Real-time not performing accurately

  • 0
  • Flutter
  • Realtime
  • Cloud
Zionnite
18 Feb, 2024, 08:04

Hello guys, I have issue with my project, Sometimes real-time does not send the latest payload,

I integrated the realtime functionality to the chat areas of my app, now sometimes users does see some messages and sometimes only one user will be seeing the latest messages of payload from the real-time function.

Please how can I handle this inconsistency?

TL;DR
Developers are encountering accuracy issues with real-time chat messages not consistently appearing. One developer shared a piece of code causing a rate limit error and received guidance to avoid reusing real-time instances. Another developer suggested checking for an active stream to spot any issues with messages being missed. Seeking help in resolving the problem, developers consider various possibilities and potential fixes, including reducing the default message count, looking into socket packages, and addressing separate real-time tasks like voice call status updates. The thread conveys frustration over the situation, with developers eager for expert advice and solutions to deliver a high-performing app experience.
Zionnite
5 Mar, 2024, 12:13

i have confirm it again and again, nothing its coming through

Zionnite
5 Mar, 2024, 12:14

i had to take my time to recheck every area of my codes, to see if maybe, i'm doing otherwise

Zionnite
5 Mar, 2024, 12:15

please @Steven is there a sample i can follow, i'm using flutter

Steven
5 Mar, 2024, 16:08

have you changed your code to not use a single realtime instance?

Zionnite
5 Mar, 2024, 16:20

Yes I have....

Steven
5 Mar, 2024, 16:29

what's your new code?

Faye
5 Mar, 2024, 16:31

Is this the same exact topic/problem as #View Not Updating?

Zionnite
5 Mar, 2024, 16:48

no, they are both different problem

Zionnite
9 Mar, 2024, 00:20

Hello @Steven @Faye @D5 @Camo

inside ref.listen nothing is outputting when i sent user a message, nor do i receive any output when user send me message but the message do send to Appwrite Cloud

DennisLBC
9 Mar, 2024, 00:23

Was that fixed in 1.5?

Zionnite
9 Mar, 2024, 13:08

please where can i see it appwrite cloud?

D5
9 Mar, 2024, 13:21

If you're using (https://cloud.appwrite.io)

Zionnite
9 Mar, 2024, 13:21

yes i am

Zionnite
9 Mar, 2024, 18:51

Below code is working for me but can someone help me check if this is the right way to do it

TypeScript
    print('Sync');
    ref.watch(getLatestChatMsgProvider).when(
          data: (data) {
            final message = MessageAppwrite.fromJson(data.payload);
            final document = Document.fromMap(data.payload);

            var event = '';
            if (data.events.contains('databases.*.collections.${Strings.collectionMessagesId}.documents.*.create')) {
              event = 'create';
            } else if (data.events.contains('databases.*.collections.${Strings.collectionMessagesId}.documents.*.delete')) {
              event = 'delete';
            } else if (data.events.contains('databases.*.collections.${Strings.collectionMessagesId}.documents.*.update')) {
              event = 'update';
            } else {
              event = 'loading';
            }

            var checkList = docList.indexWhere((element) => element == document.$id);

            print('calling here');
            if (checkList == -1) {
              print('perfect');
              docList.add(document.$id);
              if ((message.senderUserId == myUserId || message.receiverUserId == myUserId) && (message.senderUserId == friendUserId || message.receiverUserId == friendUserId)) {
                messageNotifier?.saveMessage(message, document, event);
              }
            }
            //return;
          },
          error: (error, stk) => ErrorText(error: error.toString()),
          loading: () => print('not loaded'),
        );
  }```
Zionnite
9 Mar, 2024, 18:54

The code is working perfectly well but i want you guys to help me check it if its written well because i'm now getting this error

TypeScript
flutter: AppwriteException: general_rate_limit_exceeded, Rate limit for the current endpoint has been exceeded. Please try again after some time. (429)
flutter: 
#0      ClientMixin.prepareResponse (package:appwrite/src/client_mixin.dart:73:9)
#1      ClientIO.call (package:appwrite/src/client_io.dart:373:14)
<asynchronous suspension>
#2      Databases.updateDocument (package:appwrite/services/databases.dart:123:17)
<asynchronous suspension>
flutter: ----------------------------------------------------```
Zionnite
9 Mar, 2024, 18:55

@Camo @D5 @DennisLBC @Faye @Steven

Faye
9 Mar, 2024, 19:02

Please do not ping if not neccessary

Zionnite
9 Mar, 2024, 19:05

i'm sorry for pinging, i'm just fustrated that this has taken me weeks and seem no hope

Zionnite
9 Mar, 2024, 20:21

any suggestion guys

Zionnite
9 Mar, 2024, 20:31
Zionnite
9 Mar, 2024, 20:32

This is what is now happening....

D5
9 Mar, 2024, 20:54

Does everything worked fine and now this issue appeared or is this never worked

Zionnite
9 Mar, 2024, 20:56

This is very frustrating @D5 sometimes msg will appear, sometimes the messages will not appear.

This lag is very much in the chat

Zionnite
10 Mar, 2024, 00:01

Hello.....

Please support still needed here

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more