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

Force closing the app resets the push notifications count. #351

Closed
mgiako opened this issue May 8, 2019 · 6 comments
Closed

Force closing the app resets the push notifications count. #351

mgiako opened this issue May 8, 2019 · 6 comments

Comments

@mgiako
Copy link

mgiako commented May 8, 2019

If you force the app to close (2.0b55), the new push notification count is reset.
Then I tried to check also the homeassistant.log, the count is also reset there (even with old versions).

@robbiet480
Copy link
Member

Unsure exactly what you meant here. Is this about rate limits? @SeanPM5 and I both tested and were unable to reproduce. Can you provide more info @TomBrien & @mgiako?

@mgiako
Copy link
Author

mgiako commented May 9, 2019

sending 3 notifications:

2019-05-09 09:59:58 INFO (MainThread) [homeassistant.components.mobile_app.notify] mobile_app push notification rate limits for iPhone8: 1 sent, 150 allowed, 0 errors, resets in 16:00:01
2019-05-09 10:00:07 INFO (MainThread) [homeassistant.components.mobile_app.notify] mobile_app push notification rate limits for iPhone8: 2 sent, 150 allowed, 0 errors, resets in 15:59:52
2019-05-09 10:00:09 INFO (MainThread) [homeassistant.components.mobile_app.notify] mobile_app push notification rate limits for iPhone8: 3 sent, 150 allowed, 0 errors, resets in 15:59:50

image

force close the app.
send another one:

2019-05-09 10:03:35 INFO (MainThread) [homeassistant.components.mobile_app.notify] mobile_app push notification rate limits for iPhone8: 1 sent, 150 allowed, 0 errors, resets in 15:56:24

image

... the count is reset

@mgiako
Copy link
Author

mgiako commented May 9, 2019

ok, so we revealed the mystery. Rate limits are reset at closing because the push id is also reset at each closure.
But why does someone push id change and someone doesn't?

@mgiako
Copy link
Author

mgiako commented May 11, 2019

The reset thing works, the push id changes and from that moment on it doesn't change any more at every restart. But now I think, does it end here? This way, if you finish the notifications, you can simply reset the push id and start again. Perhaps the reset should activate automatically and not be available to the user. Is it possible that the app realizes that the push id changes and automatically reset it?

@TomBrien
Copy link
Member

@mgiako I agree that it's open to exploitation maybe some automatic reset of it every few days when the app knows it is connect to HA is in order? Anyway I'm going to close this as the original bug is fixed.

@robbiet480
Copy link
Member

I'm not going to implement anything automatic to fix this as Firebase is imminently rolling out a long term fix for this, see firebase/firebase-ios-sdk#2438 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants