# Write the user row only when the profile changed · dara/icarus

[View on GitCafe](https://git.cafe/dara/icarus/commit/404dd30939a5f870c06e111dc412997d755ae279)

Repository: [dara/icarus](https://git.cafe/dara/icarus)

Visibility: public

Requested revision: 404dd30939a5f870c06e111dc412997d755ae279

Requested commit: 404dd30939a5f870c06e111dc412997d755ae279

Commit: 404dd30939a5f870c06e111dc412997d755ae279

Tree: 802846d71d522f45c330e9646f03ef9379d62e3d

Author: Dara Adedeji

Committer: Dara Adedeji

## Message

```
Write the user row only when the profile changed

ensureCurrentUser patched the caller's row (updatedAt at least) on every
call. Every query reads that row, so each call re-ran every live query the
user held: about 79 KB of reads with the editor and library open, measured
on a local deployment with dev's data. It runs on each app start and sign-in
event. Skip the write when externalId, display name and avatar are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

```

## Parents

- [1dd1f53f678b8fef7a4c520ea438cd49c96727c0](https://git.cafe/dara/icarus/commit/1dd1f53f678b8fef7a4c520ea438cd49c96727c0?format=markdown)

[Source at this commit](https://git.cafe/dara/icarus/tree/404dd30939a5f870c06e111dc412997d755ae279?format=markdown)
