Talk:Lightning Offline Sync: Difference between revisions

Jump to navigation Jump to search
Line 17: Line 17:


===50x Error Mode===
===50x Error Mode===
* '''calCachedCalendar::adoptItem''' calls up caldav::doAdoptItem and passes "aListener" which inserts the item into the cache.
* '''calCachedCalendar::adoptItem''' calls up caldav::AdoptItemOrUseCache and passes "aListener" which inserts the item into the cache.
* caldav::doAdoptItem sends request to server and passes it "addListener"
* caldav::adoptItemOrUseCache sets up opListener and calls up caldav::doAdoptItem with  "opListener"
* the request fails coz of 50x error and "addListener" is invoked
* caldav::doAdoptItem passes addListener to the POST request
* "addListener" invokes adoptItemOrUseCache() and passes it "aListener" and useCache set to 'false'
* '''addListener::onOperationComplete''' is invoked with a status of 50x
* adoptItemOrUseCache invokes adoptOfflineItem() and passes it "aListener"
* '''addListener::onOperationComplete''' invokes '''opListener::onOperationComplete''' with a NS_ERROR_CONNECTION_REFUSED status
* adoptOfflineItem() invokes "aListener" with a success code
* opListener::onOperationComplete invokes adoptOfflineItem and passes it "listener"
* adoptOfflineItem invokes listener on successful completion.
* listener::onOperationComplete invokes "aListener::onOperationComplete" with a NS_ERROR_CONNECTION_REFUSED status msg
 
It makes sense not to return a success code to "aListener" since there was no successful execution of the normal online mode.


===Reconcile Mode===
===Reconcile Mode===
43

edits

Navigation menu