From 568a78e64b9bad05b39d20230e9988a19408fa9b Mon Sep 17 00:00:00 2001 From: Kyle Pope Date: Wed, 4 Mar 2026 08:44:54 +0800 Subject: [PATCH] Show connected user's latest update time on umbral contacts Override updated_at on PersonResponse with max(Person, User, Settings) so the panel reflects when the connected user last changed their profile. Co-Authored-By: Claude Opus 4.6 --- backend/app/routers/people.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/backend/app/routers/people.py b/backend/app/routers/people.py index 5724f9c..5c031ad 100644 --- a/backend/app/routers/people.py +++ b/backend/app/routers/people.py @@ -102,13 +102,21 @@ async def get_people( ) # umbral_name is always visible (public identity), not a shareable field shared_profiles[uid]["umbral_name"] = user.umbral_name + shared_profiles[uid]["_updated_at"] = max( + user.updated_at, user_settings.updated_at + ) # Attach to response responses = [] for p in people: resp = PersonResponse.model_validate(p) if p.linked_user_id and p.linked_user_id in shared_profiles: - resp.shared_fields = shared_profiles[p.linked_user_id] + profile = shared_profiles[p.linked_user_id] + resp.shared_fields = profile + # Show the latest update time across local record and connected user's profile + remote_updated = profile.pop("_updated_at", None) + if remote_updated and remote_updated > p.updated_at: + resp.updated_at = remote_updated responses.append(resp) return responses @@ -179,6 +187,10 @@ async def get_person( linked_user, linked_settings, conn.sharing_overrides if conn else None ) resp.shared_fields["umbral_name"] = linked_user.umbral_name + # Show the latest update time across local record and connected user's profile + remote_updated = max(linked_user.updated_at, linked_settings.updated_at) + if remote_updated > person.updated_at: + resp.updated_at = remote_updated return resp