Last Comment Bug 328810 - shutting down calendar doesn't wait for in-progress writes to finish
: shutting down calendar doesn't wait for in-progress writes to finish
Status: RESOLVED FIXED
: dataloss
Product: Calendar
Classification: Client Software
Component: Internal Components (show other bugs)
: Trunk
: All All
: -- major (vote)
: ---
Assigned To: Joey Minta
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-02-27 23:03 PST by Dan Mosedale (:dmose)
Modified: 2006-10-30 16:41 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
proposal (3.93 KB, patch)
2006-06-16 11:50 PDT, Joey Minta
no flags Details | Diff | Splinter Review
i will survive (2.95 KB, patch)
2006-07-14 16:30 PDT, Joey Minta
mvl: first‑review+
Details | Diff | Splinter Review

Description Dan Mosedale (:dmose) 2006-02-27 23:03:51 PST
This was spun off of bug 218983.
Comment 1 Joey Minta 2006-06-16 11:50:29 PDT
Created attachment 225896 [details] [diff] [review]
proposal

This is how I see this bug possibly being fixed.  It's really tough to test and I'm not sure I understand all the nuances.  Another option is to piggy-back off the tryToClose window function in the main UI.  This would make it a bit easier to prompt to tell the user what's going on.  Feedback?
Comment 2 Matthew (lilmatt) Willis 2006-06-16 12:39:25 PDT
(In reply to comment #1)
> Another option is to piggy-back off the tryToClose window function in the
> main UI.

Note that closing the main window does NOT quit the app on Mac, so that approach may not work across the board
Comment 3 Joey Minta 2006-06-19 12:09:12 PDT
(In reply to comment #2)
> Note that closing the main window does NOT quit the app on Mac, so that
> approach may not work across the board
> 
There's still hiddenWindow.xul that we could use.

dmose and I wanted to get mconnor's opinion on this, as he knows this code better.
Comment 5 Joey Minta 2006-07-14 16:30:36 PDT
Created attachment 229313 [details] [diff] [review]
i will survive

Patch successfully keeps our app around until we finish the write.  Tested by delaying writing with a really big for-loop.
Comment 6 Michiel van Leeuwen (email: mvl+moz@) 2006-08-19 08:36:54 PDT
Comment on attachment 229313 [details] [diff] [review]
i will survive

>                 try  {
>+                    appStartup.enterLastWindowClosingSurvivalArea();
>                 } catch (ex) {
>+                    appStartup.exitLastWindowClosingSurvivalArea();
>                 }

Looks like you want a finally block there, instead of putting the other call to exitLastWindowClosingSurvivalArea in a completly different place in the code.
Comment 7 Joey Minta 2006-08-21 11:05:04 PDT
(In reply to comment #6)
> Looks like you want a finally block there, instead of putting the other call to
> exitLastWindowClosingSurvivalArea in a completly different place in the code.
> 
The other call is made after an observer is notified following an async call.  (after the write actually finished) |finally| has no way, that I know of, to handle that.
Comment 8 Michiel van Leeuwen (email: mvl+moz@) 2006-08-21 11:13:28 PDT
Comment on attachment 229313 [details] [diff] [review]
i will survive

whoops, you are right. async code still manages to confuse me...
r=mvl
Comment 9 Joey Minta 2006-08-23 10:09:46 PDT
patch checked in.

Note You need to log in before you can comment on or make changes to this bug.