After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 681102 - calendar: "[appointements]" as parameter fails if parameter is null
calendar: "[appointements]" as parameter fails if parameter is null
Status: RESOLVED DUPLICATE of bug 686805
Product: gnome-shell
Classification: Core
Component: calendar
3.5.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-08-03 01:34 UTC by Alban Browaeys
Modified: 2017-10-30 16:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
calendar: "[appointements]" as parameter fails if parameter is null (2.25 KB, patch)
2012-08-03 01:34 UTC, Alban Browaeys
needs-work Details | Review
[V2] calendar: "[appointements]" as parameter fails if parameter is null (2.35 KB, patch)
2012-08-03 03:08 UTC, Alban Browaeys
needs-work Details | Review

Description Alban Browaeys 2012-08-03 01:34:59 UTC
Created attachment 220192 [details] [review]
calendar: "[appointements]" as parameter fails if parameter is null

To handle the case of null passed as parameter do not use this syntactic
sugar. Instead grab the array containing the array of the appointments
and get its first index as the array of the appointments.
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-08-03 01:40:10 UTC
Review of attachment 220192 [details] [review]:

::: js/ui/calendar.js
@@ +272,3 @@
     },
 
+    _onEventsReceived: function(appointments_array) {

We should be taking an error and checking for that instead.

    _onEventsReceived: function(results, err) {
        if (params == null) {
            // do something with error
        } else {
            let [appointments] = results;
        }
    }

@@ +275,3 @@
         let newEvents = [];
+        if (appointments_array != null) {
+            appointments = appointments_array[0];

This defines a global. No.
Comment 2 Alban Browaeys 2012-08-03 03:08:02 UTC
Created attachment 220204 [details] [review]
[V2] calendar: "[appointements]" as parameter fails if parameter is null
Comment 3 Alban Browaeys 2012-08-03 03:12:46 UTC
I found the way to reproduce in the process of improving the patch.
One need a google calendar. Then change the "path" of the calendar to point to something non existant (add "/a" to the end). Then show the shell calendar and wait.
I kind of struggled to reproduce even with those steps : seems not caching the calendar and disabling/enabling it helps.
This happened to me because I had calendar long defined not managed by me and the calendar IDs changed .
Comment 4 André Klapper 2015-01-17 03:01:37 UTC
Comment on attachment 220204 [details] [review]
[V2] calendar: "[appointements]" as parameter fails if parameter is null

$:andre\> patch --no-backup-if-mismatch -p1 < aaaapatch 
patching file js/ui/calendar.js
Hunk #1 FAILED at 271.
1 out of 1 hunk FAILED -- saving rejects to file js/ui/calendar.js.rej

Hence setting 'needs-rework' as patch does not apply cleanly against git master.
Comment 5 Alban Browaeys 2017-10-30 16:13:51 UTC
Thanks it has been handling in commit a4e29e1244b097fc2bebc371e00d7af30537c376 " calendar: Handle calendar-server errors".
The only difference is in me printing the error message on remote server calendar errors.Is it of value ?
Ie:
 if (error != null) {
    log("Failed to get appointments : remote error '"+error+"'");

*** This bug has been marked as a duplicate of bug 686805 ***