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>
404dd30939Dara Adedeji committed on 10/19/2026, 7:40:52 PMparent1dd1f53
2 files changedLine totals unavailable