When rapidly adding multiple events to week view, timezone information is sometimes not correctly saved
I'm running the latest development version of GNOME calendar, at master commit 2f6aae7f213a7a5083e5ffa01c6bb1bebb6761cb
.
I'm in a UTC+02 timezone, which means that if it's 08:00 in the UTC (=UTC+00) timezone, it will be 10:00 in my timezone.
Steps to reproduce:
- Open GNOME Calendar
- go to week view
- Create a new calendar (so that if something screws up you don't loose anything) and enable it
- Create a bunch (like 10-20) of events in the new calendar using the simple popover (don't use the details popover, this should help focusing on one place of testing)
Here is a short screencast reproducing this issue (better to watch fullscreen)
Capture_d_écran_vidéo_de_13-05-2020_16_34_12
As you can see at the end of the screencast, I add an event starting at 17:00 and then it appears at 19:00. (which means two hours were added, like my UTC+02 timezone).
Some strange things :
- this happens after a random number of events. There's no logic to it, I tried multiple times, restarting the app once I notice the bug : first the 12nd, then the 13rd, then the 15th, and after being tired of doing this, the 11st one.
- The time is broken since the first time it break, until you close the app. After reopening it, new events don't break... until they do.
Here is an iCalendar with the bug that can help with this issue.
calendar_reproducing_material.ics
calendar analyzing
(I used the iCalendar specs at https://tools.ietf.org/html/rfc2445 to know all this)
open the calendar in a text editor. There is only two parts that are relevant (not the version information, etc that are directly in the VCALENDAR scope).
Here is the first part, the event that shows well, without unrelevant properties.
BEGIN:VEVENT
DTSTART;TZID=/freeassociation.sourceforge.net/Europe/Paris:
20200514T120000
DTEND;TZID=/freeassociation.sourceforge.net/Europe/Paris:20200514T123000
SUMMARY:good one
END:VEVENT
the DTSTART and DTEND are very similar, so will just look at DTSTART. DTSTART is a property of type Date-Time and corresponds to the third form of it. This one stores the timezone information in the TZID property and after the colon the date and time of the form "YYYYMMDD" "T" "HHMMSS" (without the spaces and quotation marks). The time (HHMMSS) is with timezone TZID, so UTC+02 here. This one is correctly shown.
BEGIN:VEVENT
DTSTART:20200515T153000Z
DTEND:20200515T160000Z
SUMMARY:bad one
END:VEVENT
This event was set at 15:30 but has a "Z" prefix that means UTC time (see form #2). The thing is that it's 15:30 UTC+02, not UTC+00. So for an unknown reason, the popover sometimes doesn't put the UTC+02 timezone, but sets the timezone as UTC.
All these let me think that the problem is in the "add event" popover (files src/gui/gcal-quick-add-popover.*
) because it's strange that it uses two different formats for the same timezone. The problem is not in the calendar view nor shell notification (which shows the same time as g-c) because when they see that it's at 15:30 UTC+00, they do their job and convert to my timezone, UTC+02, and add 2 hours so that's why it shows 17:30 for the bad event.
Development Tasks
-
src/gui/gcal-quick-add-popover.c
is a massive 1000 lines (which I find strange, due to the simplicity of the popover) file so this is a big thing.
QA Tasks
-
try to reproduce as described at the top of this message
Please care to tell if able to reproduce this.