Closed Bug 215971 Opened 22 years ago Closed 19 years ago

auto refresh remote calendar every x minutes

Categories

(Calendar :: General, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: k_b0000, Assigned: mvl)

References

Details

(Whiteboard: ui-review+)

Attachments

(1 file, 6 obsolete files)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030812 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030812 wish: option to automatically refresh remote calendar every x minutes/hours. global option will do fine (for me, others may say otherwise). Reproducible: Didn't try Steps to Reproduce:
maybee i was not clear enough, i am thinking of only downloading event and task from remote to local. no upload, since upload should happen when edding/removing/changing task/event. tihs feature would be good if you can expect someone else to add tings to your calendar, and you do not want to manually check every x minutes.
Ideally I would like the following preferences: - auto refresh remote calendars every x minutes - auto refresh remote calendar y minutes before each alarm The idea of a second pref is to "double-check" whether the alarm is still there before acting on it. And IMHO it should really be "y minutes before", not "right before" since when it is already time to fire an alarm, it it IMHO to late to be refreshing the remote calendar (since that could take a long time over a slow network).
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: PC → All
*** Bug 248093 has been marked as a duplicate of this bug. ***
My person here working on this has already managed to add a button to the menu bar for easier refresh, but he does not seem to be able to set up some kind of timing event. Ie, I suppose I'm asking whether there is documentation on adding configuration options, and then also, does anyone know where the code for checking mail at regular intervals is located cause I suspect this code would probably be similar. Any pointers in this regard would be *very* usefull, we could possibly even have a patch ready by next week. Unless mostafah is already working on a patch?
This is as far as I was able to get. Any time an alarm fires, the remote calendars automatically reload. I wanted to create an event with associated alarm that would repeat every minute, but the smallest repeat interval supported by Sunbird and the underlying library looks like one day. I then tried to create an event programmatically that would fire an event in a minute, upon which remote calendars would refresh and the alarm would be reset to go off in another minute. The plan was to somehow flag this as a "hidden" event, so that there would be no popup when it fires, no notation in the calendar that it exists, and no entry in the .ics file. The hitch is that I couldn't successfully create an event without bringing up the New Event dialog. Someone else may be able to do it, feel free to try. Looks to me like someone's going to have to do something in xpcom to create a special event that fires an alarm at regular (configurable) intervals, and is so flagged to be hidden from the user.
Comment on attachment 177864 [details] modified fireAlarm() calls refreshAllRemoteCalendars() I think the intention of this patch is to abuse alarms for reloading. If it is, it isn't the way to go. If is isn't, it don't see how it fixes this bug.
Attachment #177864 - Attachment is obsolete: true
*** Bug 283169 has been marked as a duplicate of this bug. ***
*** Bug 239682 has been marked as a duplicate of this bug. ***
*** Bug 292651 has been marked as a duplicate of this bug. ***
Attached patch auto-reload (obsolete) — Splinter Review
With the new calendarManagement/providers, this is pretty easy. Removes the 'reload remote calendars on startup' option, since that is obsolete and replaces it with 'automatically reload remote calendars every X minutes'.
Assignee: mostafah → jminta
Status: NEW → ASSIGNED
Attachment #191471 - Flags: first-review?(mvl)
Comment on attachment 191471 [details] [diff] [review] auto-reload >+++ mozilla/calendar/resources/content/calendarManagement.js 3 Aug 2005 11:50:26 -0000 I'm not sure about this patch. My plan was to put the autoreload into the ics provider, and combine it with syncing, to prevent dataloss and all On the other hand, this patch is simple enough, and does most of the trick. We would need a 'download before changing' though. Not sure how and where to do that. Autopublish is already part of the ics provider (and can't be turned of)
I would like to try this patch but I am unsure of how to download and install it. Can someone tell me how to do this?
Sending back to default. If the changes are going to be done in the providers, I probably won't be writing it.
Assignee: jminta → mostafah
Status: ASSIGNED → NEW
QA Contact: gurganbl → general
Attachment #191471 - Flags: first-review?(mvl)
Attached patch work in progress (obsolete) — Splinter Review
This is what i have so far. Still need to work on adding a pref.
Assignee: mostafah → mvl
Status: NEW → ASSIGNED
Can we try to drive this in for Sunbird 0.3 beta? This is a very popular enhancement request from our users as can be seen by the votes and the dupes this bug has.
Attached patch reload from calendarmanager (obsolete) — Splinter Review
The problem with the previous patch was that the prefs could not be read. Fixed that by putting the refresh in the calendar manager. That is better anyway, because other providers also might need/want to be reloaded. But this patch still has a problem: the views redraws the eventboxes. This makes the boxes flicker quite visibly. It might also be slow. This should be prevented somehow. Patch is also not finished. Still needs a user pref for the refresh time-out, and some UI to turn on auto-refresh. Attaching anyway, because i don't want to loose the patch :)
Attachment #215523 - Attachment is obsolete: true
Attached patch UI work (obsolete) — Splinter Review
This patch add some UI. It doesn't fully work yet, the prefs panel doesn't want to remember the new value. But while working on this, I wondered if this is the right way. I wondered what the usecase was for disabling auto-reload. In which cases would you want outdated information? Shouldn't auto-reload be always on (for providers that support it)?
Attachment #231261 - Attachment is obsolete: true
(In reply to comment #17) > I wondered what the usecase was for disabling auto-reload. In which cases > would you want outdated information? Shouldn't auto-reload be always on (for > providers that support it)? Possible usecase ideas: - Working offline in the same fashion as Tb - Users on dialup who don't want the app calling their isp every x minutes just because Sunbird is open - If your published calendar is hosed or otherwise updated by another app somewhere else and you don't want to lose your cached data just yet (so you can print it out, etc.)
All those reasons sound like one global pref would do, instead of a per-calendar setting. It would remove the need for a new bit of UI in the edit-calendar dialog, and thus would reduce confusion. It would also reduce the number of code paths. So I'm in favor, hoping i'm not missing an use-case for disabling reload.
(In reply to comment #17) > This patch add some UI. It doesn't fully work yet, the prefs panel > doesn't want to remember the new value. Don't forget to add the new pref to the <preferences> section too. In my opinion it is sufficient if there is one bool pref to enable/disable auto-refresh globally and one int pref to set the refresh timeout globally.
Attached patch only a pref (obsolete) — Splinter Review
This patch should do it all. Adds a pref to enable autoreload, and one to set the timeout. Makes all calendars that supprt reload, reload. Asking lilmatt for review, mainly because of the preferences part of the patch. Asking dmose mainly for the backend changes.
Attachment #191471 - Attachment is obsolete: true
Attachment #231330 - Attachment is obsolete: true
Attachment #231477 - Flags: second-review?
Attachment #231477 - Flags: first-review?(mattwillis)
Attachment #231477 - Flags: second-review? → second-review?(dmose)
Comment on attachment 231477 [details] [diff] [review] only a pref + dump("Changed to: "+autoRefreshPref+"\n"); Let's not ship the dump. + <caption label="&pref.refreshbox.label;"/> + <checkbox label="&pref.autorefresh.label;" These entities don't seem to already exist, nor are they in your patch. + <textbox id="refreshtimeout" + preference="calendar.autorefresh.timeout" + maxlength="3" + size="3"/> Do we want to use the ensurePositiveInteger() here? We use it in the Alarms already I think. Minusing on the missing entities...
Attachment #231477 - Flags: first-review?(mattwillis) → first-review-
Attached patch updated patchSplinter Review
Path now has l10n changes, plus the validateNaturalNums in the pref pane
Attachment #231477 - Attachment is obsolete: true
Attachment #231801 - Flags: second-review?(dmose)
Attachment #231801 - Flags: first-review?(mattwillis)
Attachment #231477 - Flags: second-review?(dmose)
Comment on attachment 231801 [details] [diff] [review] updated patch Index: locales/en-US/chrome/calendar/calendar.dtd =================================================================== +<!ENTITY calendarproperties.autorefresh.label "Refresh calendar every N minutes"> Delete this line per IRC. Index: locales/en-US/chrome/calendar/preferences/general.dtd =================================================================== +<!ENTITY pref.refreshbox.label "Refresh Settings" > +<!ENTITY pref.autorefresh.label "Refresh calendars every" > These should be changed to "Reload" to match the current icon label and menuitems. (and Firefox) r=lilmatt with that
Attachment #231801 - Flags: first-review?(mattwillis) → first-review+
to follow the rules, i need to ask ui-review.
Whiteboard: [cal-ui-review needed]
Whiteboard: [cal-ui-review needed] → ui-review+
*** Bug 356383 has been marked as a duplicate of this bug. ***
Comment on attachment 231801 [details] [diff] [review] updated patch Moving r2 to jminta per dmose
Attachment #231801 - Flags: second-review?(dmose) → second-review?(jminta)
Comment on attachment 231801 [details] [diff] [review] updated patch As I read this patch, the auto-refresh will result in the back-end and the front-end falling out of sync. Because we've refreshed the back-end, our etag checks will turn out fine when writing the file, resulting in silent over-write of conflicts. That seems to me like a step backwards in terms of dataloss, or am I misunderstanding something?
I'm not sure what you mean. The front-end (views etc) should stay in sync, thanks to some observers. And i don't know what you mean with etags. They don't have anything to do with the front-end.
(In reply to comment #29) > The front-end (views etc) should stay in sync, thanks to some observers. Just refreshing the calendar fires the observers? Which ones and when?
They have to be fired, otherwise our current UI to reload calenders would not work. That UI in the end calls the same code. The code is as follows: the ics calendars add all the loaded items to the memory calendar: http://lxr.mozilla.org/seamonkey/source/calendar/providers/ics/calICSCalendar.js#334 Then the memory calendar notifies the observers: http://lxr.mozilla.org/seamonkey/source/calendar/providers/memory/calMemoryCalendar.js#208 A smart view might ignore those observations, because there is a batch mode. But I'm not sure if our current views are smart like that.
Comment on attachment 231801 [details] [diff] [review] updated patch + this.mRefreshTimer = false; How about null? + setUpPrefObservers: function() { I'd really prefer if we didn't add any more anonymous functions to our code. Here and elsewhere. + var refreshEnabled = 0; Should default to |false|. + try { + var refreshEnabled = prefBranch.getBoolPref("calendar.autorefresh.enabled"); + } catch (e) { + } You're redeclaring a variable here, same thing below. The way we're using observers with the memory calendar feels like an abuse to me, but that's not a battle for this bug. Also, this code will similarly suffer from Bug 282013, but I'd be ok with that being a followup (that we may want to fix at the same time as bug 357079). Lastly, we probably need a followup about leaking the prefobservers at shutdown. r2=jminta with the above nits picked.
Attachment #231801 - Flags: second-review?(jminta) → second-review+
patch checked in
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
this issue needs more than one or two tests, eg what if event is edited and after refresh is not available any more or has changed? - integration
Whiteboard: ui-review+ → ui-review+ [litmus testcase wanted]
No, it does not need a bunch of testcases. The bug is all the summary says: "auto reload every x minutes" Nothing more. Concurrent editing and all that are not included, and are known to be broken. All the patch in this bug does is making the time window in which dataloss can occur somewhat smaller. But it's not gone yet.
(In reply to comment #35) > No, it does not need a bunch of testcases. The bug is all the summary says: > "auto reload every x minutes" Nothing more. Yes, I know - I wanted to say that we need focus what kind of bug this fix can produce in the future - so anyway testing this feature is a good way
verified with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2pre) Gecko/20061225 Calendar/0.4a1
Status: RESOLVED → VERIFIED
Comment on attachment 231801 [details] [diff] [review] updated patch The changes in preference UI from this patch ( mozilla/calendar/base/content/preferences/general.js and mozilla/calendar/base/content/preferences/general.xul) have not been checked in yet. Reopen bug?
Finally checked in the missing parts.
Litmus testcase 3000 created
Whiteboard: ui-review+ [litmus testcase wanted] → ui-review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: