[dev] [PATCH] ActiveSync: Fix email sync error on corner case

Thomas Jarosch thomas.jarosch at intra2net.com
Thu Dec 12 16:54:21 UTC 2013


On Thursday, 12. December 2013 11:23:26 Michael J Rubinsky wrote:
> Quoting Thomas Jarosch <thomas.jarosch at intra2net.com>:
> > On Thursday, 12. December 2013 17:11:01 Thomas Jarosch wrote:
> >> Hmm. What about the array_diff() call in setSoftDeleted()?
> >> I think it will destroy the array values.
> > 
> > ah, forget about that, it's not executed for NON-CONDSTORE servers.
> > Guess it must be something similar though.
> 
> Yeah. The only other place that $this->_messages is mangled is in
> updateState(), and it at least *looks* correct to me...
> 
> I think that the data structure is rather a side effect of the
> exception being thrown, and not the cause. If you look at
> setChanges(), the exception is thrown before the $flags are dealt
> with, so when updateState() is called, $flags are empty when it's
> combined with $this->_messages.

Sounds like a possibility. ActiveSync_State_Base::getChanges() calls 
getServerChanges(). If we are not pinging the folder, we call
$folder->updateState() later on.

When an Horde_Exception is thrown in getServerChanges(),
we just catch it and return an empty changes array.
Still we are executing $folder->updateState().

What about some kind of race condition: A new message / just deleted message 
is not listed in $this->_messages, but part of the $messages list given to 
setChanges(). We'll then throw the exception and kill the flags
later on in updateState().

I'll investigate more tomorrow.

Thomas



More information about the dev mailing list