Solved Random delay when sending SMS from chrome

Discussion in 'Join' started by baikunz, Dec 11, 2017.

  1. baikunz

    baikunz New Member

    Joined:
    Dec 11, 2017
    Messages:
    15
    Likes Received:
    0
    Hello,

    I've been struggling for a while with this bug. It's been like 6months/1year that whenever I send an SMS from the chrome extension, either it take a while to be send (around 15minutes), or simply ignored, or if I'm lucky it's being send right away.
    When it's failing, the spinner next to my SMS is spinning forever. If I close and reopen the popup the SMS disappeared. Then it will either send itself after a few minutes, or not send at all.
    This is very frustrating especially since it was working perfectly fine a year / 6 months ago.

    I'm using a Sony Xperia Z3 compact, and I tried everything without luck that could prevent it from working while the phone is on sleep but nothing worked. I have no idea where could the problem come from.

    Would appreciate any help !
    I can provide console logs or anything if needed, but haven't seen anything usefull :/
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Hi there! Thanks for the feedback.

    Do you think the other types of pushes also suffer from the same delays? For example, if an SMS is delayed, if you push a tab to the phone right away does it open? Or does it also take a long time?

    Thanks!
    João
     
  3. baikunz

    baikunz New Member

    Joined:
    Dec 11, 2017
    Messages:
    15
    Likes Received:
    0
    Hi !

    Thanks for your reply. In fact I never tried that way before. And I just tested the same exact thing happened. It's been a minute or so that I shared a chrome tab to my device, made it ring, still nothing showing up on the phone :/
    What's weird is that it's working wonderfully from the phone to my computer.

    Hope you can help, thanks!
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    It seems that something may be blocking Google Cloud Messaging on your device or delaying it. Maybe it's the router or network you're on? Maybe the connection is weak where you're at?
     
  5. baikunz

    baikunz New Member

    Joined:
    Dec 11, 2017
    Messages:
    15
    Likes Received:
    0
    Well, it was around 10min, still nothing received on my phone. I tried the diagnostics on chrome. Everything worked fine.
    Tried it on my phone, it triggered all the delayed actions to occur.
    Something was red though, related to Cloud messaging time out.
    Tried it again, everything green.
    It's like the process is sleeping on my phone, and when I manually trigger it, it finally happen.
     
  6. baikunz

    baikunz New Member

    Joined:
    Dec 11, 2017
    Messages:
    15
    Likes Received:
    0
    Actually I'm on the 4G network, but it's the same thing wherever I am, wifi/4G/3G same thing. It looks like it's just not reliable.
     
  7. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Is your phone rooted by any chance?
     
  8. baikunz

    baikunz New Member

    Joined:
    Dec 11, 2017
    Messages:
    15
    Likes Received:
    0
    Ok, I tried again after letting my phone sit untouched for a few minutes. Problem shows up again.
    Tried diagnose on the device here is what showed up on the device. Tried it again, it reconnected and I received all pending notifications.
     

    Attached Files:

  9. baikunz

    baikunz New Member

    Joined:
    Dec 11, 2017
    Messages:
    15
    Likes Received:
    0
    Got some news. This problem was really driving me nuts these days, so I finally took some time to investigate.
    The issue seems related to GCM/FCM and not your application. The article I pointed in my previous post explains it pretty well.

    In a nutshell:
    A socket is opened between GCM and the phone (to prevent polling). However the socket connection can silently fail anytime if no packets transits on it for a certain period of time. Depending on the carrier or router, this interval can be pretty short.
    The phone sends a heartbeat every once in a while (28minutes on mobile, 15minutes on wifi) to check if the socket is still active.
    If the socket is still active everything is fine. In my case however, it seems that my socket connection is prematurely closed, every notifications I receive until the next scheduled heartbeat are then delayed. And they can be delayed up to 28 minutes on mobile if the socket fail right after its opening.
    A workaround I'm trying right now, is reducing the heartbeat delay to 5minutes. I'm using this app (https://github.com/shaobin0604/HeartbeatFixerForGCM) to do that. For the previous 2hours it seems to work fine. I'm going to test it tomorrow the whole day and will let you know about the results.

    If that's working maybe you could implement in join itself a heartbeat fixer !
     
  10. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Thank you :) Glad it shows promise! I'll add that to my FAQ now, thanks!
     
  11. baikunz

    baikunz New Member

    Joined:
    Dec 11, 2017
    Messages:
    15
    Likes Received:
    0
    Well, I had a day at work, so I could test the fix. And I'm glad that it was a success ;-)
    It would be nice if you could implement it right in join !
     
  12. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
  13. baikunz

    baikunz New Member

    Joined:
    Dec 11, 2017
    Messages:
    15
    Likes Received:
    0
  14. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Thank you very much! :)
     
  15. iJamJL

    iJamJL New Member

    Joined:
    Aug 11, 2017
    Messages:
    2
    Likes Received:
    0
    Sorry to bring up an old thread, but I'm having this same exact issue and using the Heartbeat fixer app isn't helping with the situation. Has anyone else figured out how to solve this problem?
     
: SMS, send, fail

Share This Page