Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delayed notifications #1170

Closed
MikeJMajor opened this issue Jan 14, 2019 · 22 comments
Closed

Delayed notifications #1170

MikeJMajor opened this issue Jan 14, 2019 · 22 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@MikeJMajor
Copy link

On my OnePlus 6 notifications are often delayed until I unlock the device.

I've tried disabling all battery saving features which doesn't seem to help. I'm sure this is related to Android Pie since I've only noticed this since updating the phone, but WhatsApp doesn't seem to have the same problem (settings indicate it's using high priority messaging).

@maniac103
Copy link
Contributor

What exactly do you mean by 'high priority messaging'?
I'm using a OP6 on Pie (LineageOS 16) as well, and notifications seems fine for me.

@mueller-ma mueller-ma added the bug Indicates an unexpected problem or unintended behavior label Jan 15, 2019
@MikeJMajor
Copy link
Author

If my phone has been locked for a while and it's not being charged then OH notifications can be delayed for many minutes. If the phone is unlocked or being charged then OH notifications are instant. Unlocking the phone makes any delayed notifications appear.

In the notification settings for WhatsApp it has the "Use high priority notifications" option ticked. Not really sure what that means, but WhatsApp doesn't have any problem in immediately being able to show a notification. Perhaps this is related to high priority messages for Firebase Cloud Messaging which states they can wake the device from the doze state.

My phone is running Oxygen OS 9.0.3

@maniac103
Copy link
Contributor

maniac103 commented Jan 15, 2019

Can you please make a screenshot of that settings UI? Can't find anything similar in the AOSP settings UI at the moment.
I doubt it's related to FCM high priority messages though, because we currently don't use that. We probably should do that, though, I guess. Relevant link: https://firebase.google.com/docs/cloud-messaging/concept-options#setting-the-priority-of-a-message ... obviously this needs to be changed in openhab-cloud though.

Firebase

@mueller-ma
Copy link
Member

The latest beta in using FCM instead of GCM and the latest server sends messages as high priority fcm messages. @digitaldan Did you deploy FCM on myopenhab.org?

@MikeJMajor
Copy link
Author

The beta is still showing the same delayed behaviour.

@maniac103
Copy link
Contributor

Yes, because the openhab-cloud update wasn't deployed to myopenhab.org yet. There's nothing we can do on the client side.

@MikeJMajor
Copy link
Author

Did the openhab-cloud update actually get deployed last night since I'm still seeing the same delayed behaviour?

@chris-si
Copy link

chris-si commented Apr 6, 2019

Are there any updates regarding that problem yet? I experience the delayed notification behavior on my phone too.

@mueller-ma
Copy link
Member

Can you have a look at https://dontkillmyapp.com/ and if your device is listed there? Delayed notifications can be caused by non-standard battery savers.

@MikeJMajor
Copy link
Author

Yes my device is listed on that website. I've disabled all the battery optimisations and have confirmed that the app is still running in the background and isn't being killed.

Do the messages from the server contain a notification payload or is it just a data message?

@maniac103
Copy link
Contributor

Do the messages from the server contain a notification payload or is it just a data message?

It's just a data message. With current openhab-cloud code deployed on myopenhab.org, it should be a high priority one.

@MikeJMajor
Copy link
Author

I think there's a typo (prority instead of priority) in opehab-cloud and it's not being sent as high priority:

const firebaseOptions = {
delay_while_idle: false,
prority: 'high'
};

@maniac103
Copy link
Contributor

I think there's a typo (prority instead of priority) in opehab-cloud and it's not being sent as high priority

Ouch, that's correct. Can you create a PR against openhab-cloud for fixing this?

@MikeJMajor
Copy link
Author

PR

@chris-si
Copy link

Is there any schedule when this goes live or did the openHAB cloud already get updated?
I still receive delayed notifications if my device is not actively used.

@andiwirs
Copy link

Quickly wanted to report that I also have this issue. For my openHab app battery optimisation is disabled, so that shouldn't be a problem.

Android version: 9.0.0
Device model: Xiaomi Mi A1
Stock or customized ROM: Lineage OS 16.0 (official)
App version : 2.10.0
Build flavor : Play Store
Device language: German

@mueller-ma
Copy link
Member

@Andirs55 Can you have a look at https://dontkillmyapp.com/xiaomi?

@andiwirs
Copy link

Thanks for the hint, but i would say that does not apply to me since I do not run MIUI OS but LineageOS. I guess this comes closest to the AOSP devices and I checked that battery optimization is turned off for openHAB which is the only advice for these devices.

@mueller-ma
Copy link
Member

@digitaldan Where can I see the version of openhab-cloud on myopenhab.org?

@JenniferJohnson89
Copy link

I noticed that there is a similar problem in other repositories. Perhaps we can refer to this issue, and this oneto find more context about the bug (e.g. the Android version, or their steps to reproduce?).
Or maybe this can help us find the faulty lines and we can also refer to the fix and fix for the bug?

Besides, microg/GmsCore#1093, AmazMod/AmazMod#121, urbanairship/android-library#52, katzer/cordova-plugin-local-notifications#938 are also similar issues that may provide useful context.

@chris-si
Copy link

As far as I know @MikeJMajor already submitted a PR with the fix and the PR is already merged too. I assume the only thing missing is a new release of the openhab cloud and the deployment to the myopenhab instance.

@MikeJMajor
Copy link
Author

This seems to be fixed for me now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

6 participants