Closed Bug 328810 Opened 14 years ago Closed 14 years ago

shutting down calendar doesn't wait for in-progress writes to finish

Categories

(Calendar :: Internal Components, defect, major)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dmose, Assigned: jminta)

Details

(Keywords: dataloss)

Attachments

(1 file, 1 obsolete file)

This was spun off of bug 218983.
Whiteboard: [cal relnote]
Attached patch proposal (obsolete) — Splinter Review
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?
(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
(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.
Severity: normal → major
Flags: blocking0.3+
Attached patch i will surviveSplinter Review
Patch successfully keeps our app around until we finish the write.  Tested by delaying writing with a really big for-loop.
Assignee: base → jminta
Attachment #225896 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #229313 - Flags: first-review?(mvl)
Whiteboard: [cal relnote] → [cal relnote][patch in hand]
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.
(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 on attachment 229313 [details] [diff] [review]
i will survive

whoops, you are right. async code still manages to confuse me...
r=mvl
Attachment #229313 - Flags: first-review?(mvl) → first-review+
patch checked in.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [cal relnote][patch in hand] → [patch in hand]
Whiteboard: [patch in hand]
You need to log in before you can comment on or make changes to this bug.