Lack of automatic synchronization when displaying mail invitations
Categories
(Calendar :: E-mail based Scheduling (iTIP/iMIP), enhancement)
Tracking
(Not tracked)
People
(Reporter: ludovic.derouin, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36 Edg/125.0.0.0
Steps to reproduce:
When updates in the calendar are many and frequent, we found that there are edgecases where the user's calendar is not synchronized when he opens his mail invitations.
For instance, with two thunderbirds openned on different profiles:
- Profile A invites B
- Profile B recieves the mail invitation but does not click on it yet.
- Profile A modifies the event without sending notification.
- Profile B clicks on the invitation and accepts it.
Actual results:
The profile B accepts an older version of the invitation wich could cause trouble in the process afterward.
Expected results:
The calendar should have been refreshed so that when the invitation is displayed, it is up to date and the acceptation is matching the real event.
| Reporter | ||
Comment 1•1 year ago
|
||
We implemented a patch that automatically synchronize the calendar if needed when the user opens a mail calendar invitation.
This patchs starts a sync only if the date of the last synchro is older than the invitation itself.
index f40e4cce..d76cf2b9 100644
--- a/comm/calendar/lightning/content/imip-bar.js
+++ b/comm/calendar/lightning/content/imip-bar.js
@@ -7,6 +7,9 @@
var { cal } = ChromeUtils.import("resource:///modules/calendar/calUtils.jsm");
+// Keep in mind when the imip-bar started so we can refresh calendar later if needed.
+var lastRefresh = Date.now();
+
/**
* Provides shortcuts to set label and collapsed attribute of imip-bar node.
*/
@@ -255,6 +258,20 @@ var calImipBar = {
return;
}
+ // Force refresh when we open a mail invit, we only need this if:
+ // refresh wasn't recently done (5scd) or if the invitation is newer than the last refrest.
+ let refreshTreshold = new Date(Date.now());
+ refreshTreshold.setSeconds(refreshTreshold.getSeconds()-5);
+ if(lastRefresh < gMessage.date/1000 && lastRefresh < refreshTreshold)
+ {
+ lastRefresh = new Date(Date.now());
+ let calendars = cal.manager.getCalendars({});
+ for (i = 0; i < calendars.length; i++)
+ {
+ calendars[i].refresh();
+ }
+ }
+
let data = cal.itip.getOptionsText(itipItem, rc, actionFunc, foundItems);
if (Components.isSuccessCode(rc)) {
| Reporter | ||
Comment 2•1 year ago
|
||
in tb128, this behavior seems to be implemented through a button wich synchronize calendars (in french "Mettre à jour dans l'agenda", wich should translate to "Update in calendar" I guess).
My question is, why would the user have to clic a button ? Why not do it automaticaly on the opening of the mail invitation ?
Description
•