User talk:TonyCuba

From MozillaWiki
Jump to: navigation, search

This are my ideas to implement an Offline Support for all the providers.

- There will be an object* that will be an "IProviderInterlocutor". It will be an ICalendar.

  • (lets call it OM as offline manager)

- What will OM will look like? I think the most important things it will have is going to be:

, but basically the same)

  • and a Provider who needs offline support.

-The goal would be every time a provider who need offline is created, you create one instance of OM.

and now, how it will work?

In general here is the strategy:

-Basically it will be a midpoint in the communications between the providers and who ever need one. Is like "tell me what you want that I'll tell the provider, and if you think an answer is coming back just wait for it". It would be like that, unless:

You apply a change to a calendar(add, delete or modify an item).

-The first thing OM will do is add the item to the changeLog (why? keep reading),then it will try to apply all the changes that are in the log to the provider.

-If at that point we are online, well everything is ok, the update was a sucess, and we empty the log. If we are offline we just keep everything in the log, until next modification. Unless the user call publish, same thing, if the update to the remote calendar succeed (I am online now), we empty the log.

Before we continue, why add a change to the log before knowing if it will succeed or not? 1st: We will call the apply changes of the log just to see is there are some changes that need to be apply, so It wouldn't hurt that we add the change there, even if I have to delete it again. (is just one) 2do: For some providers, if you make some changes being offline they will crash, you may think this is good for us, crash == offline and now we know what to do then. Well, it is not, it crash but it catch also the errors, so we don't really have a way to know. What we want is the provider throw the error: "I could not update remote server". This may imply changes in the some of the providers code, thing we all want to avoid, but I think some small changes will be need it (such as this one that we can see it as a fix.

Why the store calendar? Well you may want to have a local copy of your remote calendar, work with it for a weeks while you are in the mountains, and then when you return, just conect to the internet and update your remote calendar. The change log is not useful for this, since it suppose you have a calendar, but If you start without network connection you won't be able to download your calendar, so we will do the best we can, we will give you what is in the temp store calendar, which will be as updated as you wish.

The big deal: Synchronization What about changes make offline from several clients, of to the server while some clients are offline. We will have to do 1 of this 2 thing. 1-Let the user define its own "Contradiction Policy", with a friendly interface. This sounds complicated but it is the right way to do it I think. 2-Implement a conflict resolution function, and we put the standards. This is not that open but it maybe easier to implement. I think I have an idea to solve the conflict resolution. Lets just forget about time stamps or stuff like that. Here it is: -Everybody adds, This is easy, if some client and the server add, when the client go back online, it will be something you take mine, I take yours and everybody is happy. -Two or more clients modify the item, ok, we duplicate, if you don't like it delete it!. -Someone delete, and then some else modify the same item. Well, you can always delete again, we add the new modified item. This is base in the safe idea of never lost data. Any other conflict case I miss, it will be handle similar

Questions? I expect a lot of them, I have some to myself too that I have not been able to answer yet, but I will really wish tons of them. Some of the question will hit weak points in my idea, so we can all fix it!. I expect more people join us in this project (or crusade) and provide ideas, support or even better, code!.

On implementing bug 380060

Hi, I am working on this bug as part of the Google Summer of Code 2011, and definitely will need your ideas in order to completely implement it. my irc: redDragon Mohitkanwal 03:59, 8 May 2011 (PDT)