none
Ews item query is off by about 5 minutes from actual items? RRS feed

  • Question

  • When I do a search filter for datetimereceived > "04/15/2014T22:17:00Z"  I would expect to see every item received in my mailbox 10:17Pm on.   This does not work though it's about 5 minutes off.   If I have a mail item that has the datetimereceived of the item 10:19pm, my query does not pull it.  I need to modify the filter to 04/15/2014T22:14:00Z or so.   Why would this not be exact, and my filter needs to be offset about 5 minutes?

    i am trying to pull all inbox items since my last check so basically I wrote the datetimereceived to the database and check after, but I am

    not comforitable using this anymore since the filter is off about 5 minutes.  Any suggestions?

    Wednesday, April 16, 2014 4:14 AM

All replies

  • Are you using AQS or a SearchFilter, if your using AQS queries then your querying the Content Indexes which aren't updated immediately when an email arrives so the differences your seeing maybe just Index latency. Using a SearchFilter will build a temporary restriction (searchfolder see http://blogs.msdn.com/b/dgoldman/archive/2008/07/01/microsoft-exchange-and-search-folders.aspx ) there can be some latency here as well depending in the total number of items in the folder your querying. (personally I wouldn't rely on a restriction for doing synchronization)

    Other alternatives that might work better is first use the PR_LOCAL_COMMIT_TIME_MAX http://msdn.microsoft.com/en-us/library/jj663242(v=exchg.80).aspx property to see if the underlying items in the folder have been modified since the last time you checked. If they have then you can execute your restricted query. Unless your really trying to reduce the bandwidth used by your app you don't ever really need the restriction eg just grab the last x number of emails from the folder, EWS will return them in the order or last created and just filter the results at the client side  (Or use the pull subscription or Syncfolderitems operations).

    Cheers
    Glen

    Wednesday, April 16, 2014 5:08 AM