Closed Bug 717081 Opened 12 years ago Closed 12 years ago

Get rid of extra onLoad during cached calendar sync

Categories

(Calendar :: Internal Components, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Fallen, Assigned: Fallen)

Details

Attachments

(1 file)

Attached patch Fix - v1 β€” β€” Splinter Review
This might reduce the flickering a bit during cached calendar operations.

Before, the offline items were played back and then an onLoad event was fired on completion. During async operations inbetween, the playbackAddedItems function returns, causing emptyQueue to end the internal sync state, which again fires an onLoad due to how the synchronize() function is called.

This change postpones the emptyQueue call (which will also fire an onLoad) to after the offline items were reconciled and drops the extra onLoad.

Mohit, was there any specific reason you called emptyQueue before reconciliation ends? Do you think this patch will work out without side effects?
Attachment #587513 - Flags: review?(mohit.kanwal)
Comment on attachment 587513 [details] [diff] [review]
Fix - v1

Review of attachment 587513 [details] [diff] [review]:
-----------------------------------------------------------------

Yup looks good! 

I can't remember why I did that, but I think I had adapted the code from the old completelistener which might have had the emptyQueue.
I tested it out and i can add/modify/delete as well as handle recurrences in the offline/online mode.

And yes the flicker is gone :)
Attachment #587513 - Flags: review?(mohit.kanwal) → review+
Pushed to comm-central changeset 5b6cf9b3be52
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.4
Backported to releases/comm-aurora changeset 98f65cb2e5cb
Target Milestone: 1.4 → 1.3
Backported to releases/comm-beta changeset 977925b81e00
Target Milestone: 1.3 → 1.2
You need to log in before you can comment on or make changes to this bug.