Closed Bug 329775 Opened 19 years ago Closed 18 years ago

Agenda tree doesn't update when program stays open over night

Categories

(Calendar :: Lightning Only, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jminta, Assigned: jminta)

References

Details

Attachments

(1 file, 1 obsolete file)

I woke up this morning and realized that the events listed in the agenda tree's "Today" were still the ones applicable to yesterday.  Lightning should copy Sunbird's timer that re-draws these type of widgets at midnight.
*** Bug 331596 has been marked as a duplicate of this bug. ***
Taking bug.  I have a patch, just waiting until tomorrow morning to make sure it really works.
Assignee: nobody → jminta
Attached patch timeouts and refreshPeriodDates (obsolete) — Splinter Review
Patch sets up a continuous set of timeouts to refresh the agenda tree's periods at midnight.  Works much like sunbird's unifinder/minimonth refresher.
Attachment #216943 - Flags: first-review?(dmose)
Status: NEW → ASSIGNED
*** Bug 338104 has been marked as a duplicate of this bug. ***
Comment on attachment 216943 [details] [diff] [review]
timeouts and refreshPeriodDates

dmose, any chance on you reviewing this anytime soon?
(In reply to comment #3)
> Created an attachment (id=216943)

Drive-by comment:

Are two of these necessary? If so, can we add a comment explaining why?

+    // Add an unload function to the window so we don't leak the pref observer
+    document.getElementById("messengerWindow")
+            .addEventListener("unload", ltnFinish, false);
 
     // Add an unload function to the window so we don't leak the pref observer
     document.getElementById("messengerWindow")
             .addEventListener("unload", ltnFinish, false);
(In reply to comment #6)
> (In reply to comment #3)
> > Created an attachment (id=216943) [edit]
> 
> Drive-by comment:
> 
> Are two of these necessary? If so, can we add a comment explaining why?
No, they're not, looks like a glitch in the patch.  Everything else ought to be fine, though, so I'm reluctant to re-spin until i get dmose's review comments.
Sorry for the delay; I'll try and get to this tonight or tomorrow.
Comment on attachment 216943 [details] [diff] [review]
timeouts and refreshPeriodDates

>+    // Is an nsITimer/callback extreme overkill here? Yes, but it's necessary to
>+    // workaround bug 291386.  If we don't, we stand a decent chance of getting
>+    // stuck in an infinite loop.

Can you tweak this comment to include the information you gave me in IRC re the other bug and that the reason this is a good workaround is because setTimeout is even more susceptible to the problem than nsITimer.

>+    var udCallback = {
>+        notify: function(timer) {

Please make this function non-anonymous for stacktrace readability.

>+    // Add an unload function to the window so we don't leak the pref observer
>+    document.getElementById("messengerWindow")
>+            .addEventListener("unload", ltnFinish, false);

No need for the duplicate call here.

>+function updateTodayWidgets() {
>+    agendaTreeView.refreshPeriodDates();
>+    document.getElementById("ltnMinimonth").refreshDisplay();
>+
>+    // refresh the current view, if it has ever been shown

Can you include in the comment why this is necessary?

>+    // set up another timer

The remaining code in this function appears to have been copy-pasted.  How about factoring this out into its own function?  Given that Sunbird also does something like this, is there a reasonable shared place where that function could live instead being forked?
Attachment #216943 - Flags: first-review?(dmose) → first-review-
Adding dependency so that we have a shared place for this code in both Sunbird and Lightning.
Depends on: 337941
*** Bug 344867 has been marked as a duplicate of this bug. ***
I love unifying code.  Patch unites Sunbird's midnight-update mechanism with Lightning's non-existent one.  Refactoring  the Sunbird code gives them a big startup perf win (since they don't need to draw the unifinder/views twice).  Lightning takes a very minor startup perf hit to schedule the timer, but it's necessary to fix this very visible bug.
Attachment #216943 - Attachment is obsolete: true
Attachment #230660 - Flags: first-review?(dmose)
Comment on attachment 230660 [details] [diff] [review]
unified midnight update service

+/* Creates a timer that will fire after midnight.  Pass in a function as 
+ * aRefreshCallback that should be called at that time.
+ */
doxygen style comments would be nice.
r=dmose
Attachment #230660 - Flags: first-review?(dmose) → first-review+
patch checked in. woot.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Verified with Thunderbird 1.5.0.5 (20060719) + Lightning/0.1+ (2006080207).
Status: RESOLVED → VERIFIED
*** Bug 351355 has been marked as a duplicate of this bug. ***
I installed Lightning (build 2006090406) yesterday (Monday the 4th) and this morning (Tuesday the 5th) when I went into Thunderbird, the calendar was still sitting on Monday the 4th.  

Is there something special that needs to be done to make this work?
Is there anything in the JavaScript console?
I have seen this in 0.3RC1 & RC2 on WindowsXP when using hibernate overnight
this is not working for me.
I use thunderbird 1.5.0.7 (20060909) and ligthning 0.3(2006100618)
I'm using a laptop and I hibernate it during the night. (so it's closed at midnight)
I don't close thunderbird every day.
After a few day, I still see "today" showing the same day (ie for example, sunday when it's really tuesday...).

look's like something is missing to handle this case.
*** Bug 357079 has been marked as a duplicate of this bug. ***
I have got the problem again this night!
Thunderbird 1.5.0.7 (20060909) + Lightning/0.3 (2006101608)

So, I don't think it's fixed...
I reopened Bug 357079 because this is a slightly different problem. This Bug is about update problem if Sunbird/Thunderbird runs overnight. Bug 357079 is about update problem after System resumes from Hibernate state but was not running overnight. Therefore a different solution than the timer callback is required.
I got the error this night. I had something to do yesterday, and it was still in the items today. I had to close/reopen thunderbird to fix the issue.

Thunderbird version 1.5.0.5 (20060904)
Lightning version 0.3.1 (2007021403)

Gentoo GNU/Linux machine.
Depends on: 291386
I'm getting this same bug with Thunderbird 2.0.0.6 and Lightning 0.5 on Mac OS X.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: