locked
EWS, Cached Mode and Deleting RRS feed

  • Question

  • Hello!  We started something new at work, syncing our old home-built calendar application to Outlook using EWS.  We're all using Cached mode, save a very select few, and that doesn't seem that it will change at all.  And I've started to notice some odd behavior with EWS and deleting.

    For those in cached mode -- If we delete an appointment from Outlook after it's been "synced" from our old system through EWS, things work fine.  If we delete the appointment in Outlook, then delete the appointment immediately after in our old system, things still work OK (i.e. no "item not found" errors).  If we delete the appointment in Outlook and then wait an extended period of time and delete from our old system, there's an error thrown with "the message resource is present but the message is not found in the string/message table" as the message.

    For those not in cached mode -- The error bolded above is thrown immediately after the delete from our old system tries to delete from Outlook using EWS.

    We do a search for items using a search filter and extended properties before we try to delete (FindItems method), but would adding something like a SearchFilter.Exists() to the filter help us grab only those that physically exist, not just cached exist?  Or is there something else that we should be doing to work with Cached mode and deletes?  Taking everyone out of cached mode is not an option, in case that wasn't clear.

    Thursday, March 22, 2012 1:41 PM

Answers

  • The only thing I can suggest is that you change the code to test if the item is there before you delete it.  Or put the delete code in a try ... catch thing, and check the error message within the catch part for the "the message resource is present but the message is not found in the string/message table" message.  If it's not there (i.e. something else caused the error), then go ahead and send the warning email.

    Mobile OWA For Smartphone
    www.leederbyshire.com
    email a@t leederbyshire d.0.t c.0.m

    • Marked as answer by RStieber Thursday, April 12, 2012 6:10 PM
    Friday, March 23, 2012 3:07 PM

All replies

  • If I understand your question correctly, it seems to me that you are simply deleting the same thing twice.  You don't see an error when you try the EWS delete immediately after the Outlook delete because Outlook probably hasn't decided to sync the change yet.  So the item is still in the store at the EWS delete time.  In the other cases (Uncached mode, and waiting a long time in cached mode), the item has already been deleted when you try the EWS delete.  I would probably just ignore the error if it appears to indicate that you're trying to delete something that's already gone, especially since it is probably going to happen regularly.

    Mobile OWA For Smartphone
    www.leederbyshire.com
    email a@t leederbyshire d.0.t c.0.m

    Thursday, March 22, 2012 4:54 PM
  • If I understand your question correctly, it seems to me that you are simply deleting the same thing twice.  You don't see an error when you try the EWS delete immediately after the Outlook delete because Outlook probably hasn't decided to sync the change yet.  So the item is still in the store at the EWS delete time.  In the other cases (Uncached mode, and waiting a long time in cached mode), the item has already been deleted when you try the EWS delete.  I would probably just ignore the error if it appears to indicate that you're trying to delete something that's already gone, especially since it is probably going to happen regularly.

    Mobile OWA For Smartphone
    www.leederbyshire.com
    email a@t leederbyshire d.0.t c.0.m

    You are correct, that is essentially what is happening.  What I want to know is if there's some way to detect those situations and bypass the delete from EWS, or if we're stuck with it.  It's not a super big deal if we can't, it just causes some false-positives in our warning system, which emails me.  I usually check them all out, but I'd like to only really have to worry about the ones where things actually go wrong ;)
    Thursday, March 22, 2012 4:58 PM
  • The only thing I can suggest is that you change the code to test if the item is there before you delete it.  Or put the delete code in a try ... catch thing, and check the error message within the catch part for the "the message resource is present but the message is not found in the string/message table" message.  If it's not there (i.e. something else caused the error), then go ahead and send the warning email.

    Mobile OWA For Smartphone
    www.leederbyshire.com
    email a@t leederbyshire d.0.t c.0.m

    • Marked as answer by RStieber Thursday, April 12, 2012 6:10 PM
    Friday, March 23, 2012 3:07 PM