# Outlook saves your event again two minutes after you write it

> Write an event through Microsoft Graph and Exchange saves it again, twice, with a new etag each time. Why that reads as an edit, and how to tell it apart.

Published 26 November 2026. https://calmonkey.com/blog/outlook-saves-your-event-again

Write an event to a Microsoft 365 calendar through Microsoft Graph and the mailbox saves it again by itself: once within a few seconds, and once more about two minutes later. If your sync treats a new etag as "someone changed this event", every write your app makes comes back to it as an edit; compare the fields you care about instead, and only for events your app wrote.

## What you see

You create or update an event with a `POST` or `PATCH`. Graph answers with the event, including its `@odata.etag` and `changeKey`. You store them.

Then, without anyone touching the calendar:

- A few seconds later the event has a new `changeKey`, a new `@odata.etag` and a new `lastModifiedDateTime`.
- About two minutes after the write it happens again.
- The subject, body, times, location, guests and the Teams link are exactly what they were.
- Each of those saves sends a change notification to your subscription, and the event comes back in your next [delta](https://learn.microsoft.com/en-us/graph/delta-query-events) round.

So the etag you got back from your own write is not the etag the event ends up with. An "is this my own write?" check that compares etags fails twice for every write.

We have measured this on Microsoft 365 work mailboxes. We have not measured it on personal Outlook.com accounts.

## Why it matters

The obvious sync loop is: a notification arrives, you read the event, the etag differs from the one you stored, so the event changed, so you tell the rest of your product. With this behaviour that loop turns every write into one or two phantom edits:

- Your own webhook consumers get change events for changes nobody made.
- An "updated" timestamp you show in your UI moves for no reason.
- Worst case, your app reacts to the "edit" by writing again, and the mailbox answers with two more saves.

Graph's [change notifications](https://learn.microsoft.com/en-us/graph/change-notifications-overview) tell you which event changed, not what changed, so you have to read the event to find out. That is also where the fix goes.

## The fix: compare what a read shows, not the etag

Keep two things for every event your app wrote: the etag, and a fingerprint of the fields your app actually uses, taken from a read. When the etag moves but the fingerprint does not, the mailbox saved the event again. Store the new etag and stop there.

Read with the same `Prefer` header every time, so the values you fingerprint do not change shape between reads: immutable ids, times in UTC and the body as text.

```ts
const PREFER = 'IdType="ImmutableId", outlook.timezone="UTC", outlook.body-content-type="text"';
const SELECT = "subject,body,start,end,location,showAs,isAllDay,isCancelled,attendees,onlineMeeting";

async function readEvent(token: string, id: string) {
  const res = await fetch(`https://graph.microsoft.com/v1.0/me/events/${id}?$select=${SELECT}`, {
    headers: { Authorization: `Bearer ${token}`, Prefer: PREFER },
  });
  if (!res.ok) throw new Error(`Graph answered ${res.status}`);
  return res.json();
}

// The fields your product shows or acts on. Leave out anything Exchange changes by itself.
function fingerprintOf(ev: any): string {
  return JSON.stringify([
    ev.subject,
    ev.body?.content,
    ev.start?.dateTime,
    ev.end?.dateTime,
    ev.location?.displayName,
    ev.showAs,
    ev.isAllDay,
    ev.isCancelled,
    (ev.attendees ?? []).map((a: any) => `${a.emailAddress?.address?.toLowerCase()} ${a.status?.response}`).sort(),
    ev.onlineMeeting?.joinUrl ?? null,
  ]);
}

type Seen = { etag: string; fingerprint: string; ours: boolean };

// After your own POST or PATCH: read the event back and remember it as yours.
async function rememberOwnWrite(token: string, id: string, store: Map<string, Seen>) {
  const ev = await readEvent(token, id);
  store.set(id, { etag: ev["@odata.etag"], fingerprint: fingerprintOf(ev), ours: true });
}

// For every change notification (or delta entry) about one event.
async function onEventChange(token: string, id: string, store: Map<string, Seen>) {
  const ev = await readEvent(token, id);
  const etag = ev["@odata.etag"];
  const fingerprint = fingerprintOf(ev);
  const seen = store.get(id);
  if (seen?.etag === etag) return "unchanged";
  if (seen?.ours && seen.fingerprint === fingerprint) {
    store.set(id, { ...seen, etag }); // Exchange saved it again: nothing to report
    return "saved-again";
  }
  store.set(id, { etag, fingerprint, ours: seen?.ours ?? false });
  return "changed";
}
```

Two details in there matter more than they look.

**Fingerprint from a read, never from what you sent.** Once a Teams meeting is on the event, the body Graph returns is your description followed by the join text Exchange adds (the "Microsoft Teams meeting" block with the join link, meeting id and passcode). A fingerprint of the body you sent would differ from every read, and every event with a meeting would look edited.

**Read the event back after your own write.** That read is the baseline the next notification is compared with. If you only keep the write's response, the first save by the mailbox already looks like a change, because its etag is not the one the write answered with.

## Only for events your app wrote

It is tempting to apply the same rule to every event: new etag, same fields, ignore it. We decided against that. For other people's events, a new etag with nothing different in the fields you keep can be a real change you do not track. A guest answering an invitation is the common one: if your fingerprint has no guest answers in it (because your product does not store guests), the answer looks exactly like a save by the mailbox. So events your app did not write still count as changed when their etag moves. That costs a notification now and then; hiding a real answer costs more.

## Edge cases we hit

- **Writing the body back removes the Teams meeting.** A `PATCH` with a `body` keeps the meeting only when the new body still contains the meeting's join URL. If your code reacts to a phantom edit by writing the event again with the description it has on file, the meeting is gone, and setting `isOnlineMeeting: true` afterwards makes a new link, not the old one. Leave `body` out of a `PATCH` that does not change the description.
- **Two saves, not one.** The second save comes about two minutes after the write, long after a short "ignore notifications for a few seconds after a write" window has closed. Time windows do not fix this; comparing fields does.
- **Notifications in a burst.** One write can produce two or three notifications for the same event within minutes. Reading the event once per burst (queue a sync for the event and let later notifications for it join the queued one) saves Graph calls and keeps the order simple.
- **Ids that change.** Without `IdType="ImmutableId"` an event's id can change when it moves between folders, and your store loses track of which events are yours. Ask for [immutable ids](https://learn.microsoft.com/en-us/graph/outlook-immutable-id) on every call, reads and writes alike.

We built CalMonkey so we would not have to do this per provider. If you would rather not either: `npx calmonkey init`.
