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

iOS PWA problems #1203

Open
gw8484 opened this issue Oct 22, 2024 · 2 comments
Open

iOS PWA problems #1203

gw8484 opened this issue Oct 22, 2024 · 2 comments
Labels
🪲 bug Something isn't working

Comments

@gw8484
Copy link

gw8484 commented Oct 22, 2024

🐞 Describe the bug

When opening iOS PWA after getting push notification it often does not:

  1. Update the notification display with the new notification messages.
  2. Update the badge count display on the PWA home screen icon.

The iOS PWA should update immediately when opened after new push notification is received and it should reset the badge count on the iOS PWA home screen icon.

BTW, the same web app works as expected in a Chrome browser on a Linux desktop.

💻 Components impacted

iOS 17.6.1
ntfy v2.11.0 self hosted Docker instance on Ubuntu 22.04

💡 Screenshots and/or logs

Here is a snippet of the server log when the PWA opens but DOES NOT update where the subscription topic (/appm1) does not appear to be requested (Note, the public IP addresses have been changed):

2024/10/21 23:42:10 DEBUG HTTP request started (http_method=GET, http_path=/st_1DxBLrCgXJYXZ/ws?auth=QmVhcmVyIHRrX245NnE1OHk2anVieWx1MHFzdWZzaHlrcnoyNmR1, tag=http, user_id=u_11sCmqbbhZ, user_name=user1, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:77.77.77.77, visitor_ip=77.77.77.77, visitor_messages=2, visitor_messages_limit=17280, visitor_messages_remaining=17278, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=60, visitor_seen=2024-10-21T23:42:10.041Z)
2024/10/21 23:42:10 DEBUG Access to topic st_1DxBLrCgXJYXZ not authorized (error=unauthorized, http_method=GET, http_path=/st_1DxBLrCgXJYXZ/ws?auth=QmVhcmVyIHRrX245NnE1OHk2anVieWx1MHFzdWZzaHlrcnoyNmR1, tag=http, topic=st_1DxBLrCgXJYXZ, topic_last_access=2024-10-21T23:29:00.992Z, topic_subscribers=0, user_id=u_11sCmqbbhZ, user_name=user1, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:77.77.77.77, visitor_ip=77.77.77.77, visitor_messages=2, visitor_messages_limit=17280, visitor_messages_remaining=17278, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=59.0000454276, visitor_seen=2024-10-21T23:42:10.041Z)
2024/10/21 23:42:10 DEBUG WebSocket error (this error is okay, it happens a lot): forbidden (error=forbidden, error_code=40301, http_method=GET, http_path=/st_1DxBLrCgXJYXZ/ws?auth=QmVhcmVyIHRrX245NnE1OHk2anVieWx1MHFzdWZzaHlrcnoyNmR1, http_status=403, tag=websocket, topic=st_1DxBLrCgXJYXZ, topic_last_access=2024-10-21T23:29:00.992Z, topic_subscribers=0, user_id=u_11sCmqbbhZ, user_name=user1, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:77.77.77.77, visitor_ip=77.77.77.77, visitor_messages=2, visitor_messages_limit=17280, visitor_messages_remaining=17278, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=59.0000614642, visitor_seen=2024-10-21T23:42:10.041Z)
2024/10/21 23:42:10 DEBUG HTTP request finished (http_method=GET, http_path=/st_1DxBLrCgXJYXZ/ws?auth=QmVhcmVyIHRrX245NnE1OHk2anVieWx1MHFzdWZzaHlrcnoyNmR1, tag=http, time_taken_ms=0, user_id=u_11sCmqbbhZ, user_name=user1, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:77.77.77.77, visitor_ip=77.77.77.77, visitor_messages=2, visitor_messages_limit=17280, visitor_messages_remaining=17278, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=59.000066507, visitor_seen=2024-10-21T23:42:10.041Z)

Here is a snippet of the server log when the PWA open and DOES update everything where the subscription topic (/appm1) is requested:

2024/10/21 23:54:29 DEBUG HTTP stream connection opened (http_method=GET, http_path=/appm1/json?poll=1&since=nhWgHwucvDop, tag=subscribe, user_id=u_11sCmqbbhZ, user_name=user1, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:77.77.77.77, visitor_ip=77.77.77.77, visitor_messages=2, visitor_messages_limit=17280, visitor_messages_remaining=17278, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=56.3817183308, visitor_seen=2024-10-21T23:54:29.42Z)
2024/10/21 23:54:29 DEBUG Access to topic st_1DxBLrCgXJYXZ not authorized (error=unauthorized, http_method=GET, http_path=/st_1DxBLrCgXJYXZ/json?poll=1, tag=http, topic=st_1DxBLrCgXJYXZ, topic_last_access=2024-10-21T23:29:00.992Z, topic_subscribers=0, user_id=u_11sCmqbbhZ, user_name=user1, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:77.77.77.77, visitor_ip=77.77.77.77, visitor_messages=2, visitor_messages_limit=17280, visitor_messages_remaining=17278, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=56.3817238494, visitor_seen=2024-10-21T23:54:29.42Z)
2024/10/21 23:54:29 DEBUG Connection closed with HTTP 403 (ntfy error 40301) (error=forbidden, error_code=40301, http_method=GET, http_path=/st_1DxBLrCgXJYXZ/json?poll=1, http_status=403, tag=http, topic=st_1DxBLrCgXJYXZ, topic_last_access=2024-10-21T23:29:00.992Z, topic_subscribers=0, user_id=u_11sCmqbbhZ, user_name=user1, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:77.77.77.77, visitor_ip=77.77.77.77, visitor_messages=2, visitor_messages_limit=17280, visitor_messages_remaining=17278, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=56.381962958799996, visitor_seen=2024-10-21T23:54:29.42Z)
2024/10/21 23:54:29 DEBUG HTTP request finished (http_method=GET, http_path=/st_1DxBLrCgXJYXZ/json?poll=1, tag=http, time_taken_ms=2, user_id=u_11sCmqbbhZ, user_name=user1, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:77.77.77.77, visitor_ip=77.77.77.77, visitor_messages=2, visitor_messages_limit=17280, visitor_messages_remaining=17278, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=56.3819924882, visitor_seen=2024-10-21T23:54:29.42Z)
2024/10/21 23:54:29 DEBUG HTTP stream connection closed (http_method=GET, http_path=/appm1/json?poll=1&since=nhWgHwucvDop, tag=subscribe, user_id=u_11sCmqbbhZ, user_name=user1, visitor_auth_limiter_limit=0.016666666666666666, visitor_auth_limiter_tokens=30, visitor_id=ip:77.77.77.77, visitor_ip=77.77.77.77, visitor_messages=2, visitor_messages_limit=17280, visitor_messages_remaining=17278, visitor_request_limiter_limit=0.2, visitor_request_limiter_tokens=56.3820618692, visitor_seen=2024-10-21T23:54:29.42Z)

🔮 Additional context

It seems the PWA is not always aware of the new push notifications so not requesting update for the relevant topics.
How does the PWA determine when to request updates for each subscribed topic?
Is there a way for users to force a full reload in the PWA launched from the home screen?

FYI, it does appear that sometimes after a while (>5 minutes) the PWA would eventually request update for the subscribed topic and display the new notification messages.

@gw8484 gw8484 added the 🪲 bug Something isn't working label Oct 22, 2024
@gw8484
Copy link
Author

gw8484 commented Oct 23, 2024

After some additional testing, it seems that notification also stops working after a while.

Not sure if this has been reported for ntfy but it appears there are some known issues with PWA on iOS (firebase/firebase-js-sdk#8010). The main issue is seemingly random reset of web push registrations. So, I am guessing it could be causing weird problems in ntfy including the ones reported earlier.

Unfortunately, it looks like PWA is not quite ready for prime time on iOS. It's really too bad. I was hoping PWA could be a viable alternative to the native app on iOS. The great work on ntfy is much appreciated in any case.

@wunter8
Copy link
Contributor

wunter8 commented Oct 23, 2024

Thanks for looking into it some more. I haven't heard of others having issues with the PWA on iOS, but we'll keep this in mind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants