For ErrorItemNotFound
, we've investigated this error in the past, and it always correctly indicates that the item is not present on the server. There are a variety of ways this can happen, and some cases are transient while others are permanent.
Based on data collected earlier, I would expect about 1% or fewer GetItem
requests to return ErrorItemNotFound. The error rate could vary across add-ins since the transient cases would depend on when the user interacts with the item.
When a user or service moves an item to another folder (i.e. archiving, deleting, or triaging an item), this causes the id of the item to change. An ItemNotFound error could be returned by an add-in running on a different client with an out-of-date view (even if the item appears on the user's screen, and they are able to run an add-in on it). Or, it could be returned by an add-in running on the same client if the move hasn't been synced to the server.
Clients with cached/offline data, like Win32 Outlook running in cached mode can experience transient ItemNotFound errors. If Outlook hasn't run in a while, or the user just configured their mailbox, Outlook could have a large number of items to sync, and this can delay syncing any changes to items or new items up to the server. If it's syncing other items, or temporarily disconnected from the server, it could allow the add-in to run before the item is available on the server. The item could be for a newly created item, or an item that was moved (i.e. archived/deleted/or otherwise triaged by the user).
Win32 Outlook has the ability (through MAPI) to return item ids that aren't available yet on the server. This is most noticeable when composing an email, but could also impact Read scenarios like in the following example.
I've personally seen this happen in Win32 Outlook after sending a message and opening it (in Read mode) from the Sent items folder (while Outlook was busy syncing items in other folders since I hadn't used that laptop in a few weeks). Outlook could have created the item there locally rather than downloading it from the server as you might expect.
If an add-in relies on data available both locally and from a server, it could provide reduced functionality, or show an error that the item can't be retrieved from the server.
If a service performs an asynchronous operation on an item from its backend, it could hold onto the request and try again later. But, since some portion of these errors are permanent, there's no guarantee that the request will succeed later.