nextcloud / calendar

📆 Calendar app for Nextcloud
https://apps.nextcloud.com/apps/calendar
GNU Affero General Public License v3.0
947 stars 229 forks source link

Browser push notifications won't work #3000

Open astrojuanlu opened 3 years ago

astrojuanlu commented 3 years ago

Steps to reproduce

  1. Allow push notifications in the browser
  2. Add several events on the web interface, with several reminders each over a span of 2 hours
  3. Wait for the reminder times to arrive

Expected behaviour

I receive a push notification on the browser.

Actual behaviour

I receive no push notification at all.

Calendar app

Calendar app version: 2.0.5 (The Good Cloud) and 2.1.3 (Disroot)

CalDAV-clients used: N/A

Client configuration

Browser: Firefox 86 and 87, Chromium 89

Operating system: Linux Mint

Server configuration

I have no access to the server configuration.

astrojuanlu commented 2 years ago

Hello! 5 months have passed, and I'd like to understand if this issue report has received 0 attention because

a) It lacks some essential information on how to reproduce it, b) I am the only person in the world that is affected by this, c) Something else?

I really want to keep using NextCloud Calendar but I keep missing events because of lack of push notifications and I don't know what else to do. I don't know how to throw money at the problem either, since I don't see a preferred bug bounty program.

At the very least, I'd love to have confirmation that this works fine for everybody else and I'm just a moron, or my computer is weird, or I have a JavaScript addon that prevents this from working, or what.

ChristophWurst commented 2 years ago

I am the only person in the world that is affected by this,

Apparently this. I have not seen any more reports about this, but I also don't use this feature personally.

Could you check if your oc_calendar_reminders table gets populated when you create events?

astrojuanlu commented 2 years ago

Thanks a lot @ChristophWurst. I don't have access to the oc_calendar_reminders table since I'm a mere user, I have no access to the server. This comes from a report on Disroot http://forum.disroot.org/t/calendar-notifications-not-working/8147 and I have also tried The Good Cloud.

In any case, if nobody else is affected by this, that gives me hope. If the only way to debug this is to install NextCloud locally, then I can setup a local deployment.

ChristophWurst commented 2 years ago

I've created a PR to debug this: https://github.com/nextcloud/server/pull/28703

Once applied it will write to nextcloud.log when it processes reminders (given they are at some point written to the DB). Set your log level to debug and give this a try.

ChristophWurst commented 2 years ago

Oh, I'm reading your comment too late. If you have a local instance to test please help me narrow down there this is coming from. Right now I don't know where to start looking.

astrojuanlu commented 2 years ago

I tried this locally with the Docker image as explained in https://github.com/nextcloud/docker#using-the-apache-image and still no luck, however I only see HTTP logs and there's not much info available.

Testing your PR might be a bit challenging, since there seems to be no Docker instructions for development. I will try to follow the documentation here https://docs.nextcloud.com/server/latest/developer_manual/getting_started/devenv.html but I'm 100 % new to PHP and NextCloud, so definitely it won't be today.

ChristophWurst commented 2 years ago

No worries. I can try to have a deeper look but right now I'm not able to reproduce. Let's see, maybe someone else can help.

tcitworld commented 2 years ago

Can you export an event affected as .ics, open it with any text editor and post what's between

BEGIN:VALARM

and

END:VALARM

So we can make sure the issue lies in the server part handling notifications and not in the calendar app?

Note that we don't have push notifications, only long-time polling. (Related: https://github.com/nextcloud/server/issues/22379 and https://github.com/nextcloud/calendar/issues/31)

astrojuanlu commented 2 years ago

Since I keep coming back to this, here is an .ics of an event I just created:

BEGIN:VCALENDAR
PRODID:-//IDN nextcloud.com//Calendar app 3.3.0//EN
CALSCALE:GREGORIAN
VERSION:2.0
BEGIN:VEVENT
CREATED:20220524T131921Z
DTSTAMP:20220524T131937Z
LAST-MODIFIED:20220524T131937Z
SEQUENCE:2
UID:71cd736c-f3a7-47a6-b4e1-4f3deeae092f
DTSTART;TZID=Europe/Madrid:20220524T153000
DTEND;TZID=Europe/Madrid:20220524T160000
STATUS:CONFIRMED
SUMMARY:PLEASE NOTIFY ME
BEGIN:VALARM
ACTION:DISPLAY
TRIGGER;RELATED=START:-PT30M
END:VALARM
BEGIN:VALARM
ACTION:DISPLAY
TRIGGER;RELATED=START:-PT5M
END:VALARM
BEGIN:VALARM
ACTION:DISPLAY
TRIGGER;RELATED=START:-PT10M
END:VALARM
BEGIN:VALARM
ACTION:DISPLAY
TRIGGER;RELATED=START:-PT15M
END:VALARM
BEGIN:VALARM
ACTION:DISPLAY
TRIGGER;RELATED=START:PT0S
END:VALARM
END:VEVENT
BEGIN:VTIMEZONE
TZID:Europe/Madrid
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
END:VCALENDAR

And here is a video of how I did it:

https://user-images.githubusercontent.com/316517/184087667-b88a2b13-cc0a-4780-bf54-92a3c312154e.mp4

Just so I understand, is there anything preventing Nextcloud Calendar from implementing something like this?

var notification = new Notification("You have a meeting");

// Louder
bell = new Audio("https://www.orangefreesounds.com/wp-content/uploads/2022/04/Small-bell-ringing-short-sound-effect.mp3?_=1");
bell.addEventListener("canplaythrough", event => {
  bell.play();
});

// LOUDER
window.focus();
window.alert("YOU HAVE A MEETING");

The only explanation I can think of why this is not requested more often is because folks use NC Calendar as a server to store their events, but then they have a client app that handles notifications for them. To be 110 % clear: that's not what I want here.

amecreate commented 2 years ago

Hi I experience the same issue on Nextcloud. Nextcloud version 23.0.3. Calendar app 3.3.1 No push notification or email for calendar event. “Send notifications for events” and “Enable notifications for events via push” are activated in the admin setting.

juengling commented 2 years ago

As @amecreate said:

No push notification or email for calendar event.

Same here: NC v24.0.1, Calendar 3.3.1 on Firefox 100.0.2 (64bit) on Ubuntu.

ChristophWurst commented 2 years ago

Could it be related to https://github.com/nextcloud/calendar/issues/3946 and https://github.com/nextcloud/server/pull/31337?

juengling commented 2 years ago

Could it be related to #3946 and nextcloud/server#31337?

Well, #3946 regards notifications which are sent to too many people, while in my case there's no notification at all.

And for nextcloud/server#31337 (nice number :-), the shown setting "enable notifications for events via push" has been unchecked in my installation, no idea why. But even after checking it, there comes no notification with a new event.

amecreate commented 2 years ago

https://github.com/nextcloud/server/pull/31337 : settings for notifications are checked. https://github.com/nextcloud/calendar/issues/3946 : no notification or email even if I add myself as attendee, or create a talk room.