Skip to content

feat(email): emit photo_synced refresh event when self-contact photo uploads#4065

Merged
gbirman merged 1 commit into
mainfrom
gab/macro-cAXr9fBV8eV72Xw85TcXF-multi-inbox-ws-driven-avatar-fill-in-replace-links-polling
Jun 15, 2026
Merged

feat(email): emit photo_synced refresh event when self-contact photo uploads#4065
gbirman merged 1 commit into
mainfrom
gab/macro-cAXr9fBV8eV72Xw85TcXF-multi-inbox-ws-driven-avatar-fill-in-replace-links-polling

Conversation

@gbirman

@gbirman gbirman commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Moves the inbox avatar off interim links polling onto a WS signal: the SFS uploader emits a refresh_email PhotoSynced event once an inbox's self-contact photo finishes uploading, gated so correspondent and attachment uploads don't fire it. Includes the regenerated service-email types; the frontend consumer is a stacked follow-up.

…uploads

The SFS uploader now sends a `refresh_email` `PhotoSynced` event over the
connection gateway once an inbox's self-contact photo finishes uploading,
gated so correspondent and attachment uploads don't trigger it. Regenerates
the service-email types.
@macro-application

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f8e998ea-a79e-44e5-ab0a-5ac494321ad8

📥 Commits

Reviewing files that changed from the base of the PR and between e528f6a and ead8bd6.

⛔ Files ignored due to path filters (4)
  • js/app/packages/service-clients/service-email/generated/schemas/index.ts is excluded by !**/generated/**
  • js/app/packages/service-clients/service-email/generated/schemas/refreshEmailEvent.ts is excluded by !**/generated/**
  • js/app/packages/service-clients/service-email/generated/schemas/refreshEmailEventOneOfOneone.ts is excluded by !**/generated/**
  • js/app/packages/service-clients/service-email/generated/schemas/refreshEmailEventOneOfOneoneEvent.ts is excluded by !**/generated/**
📒 Files selected for processing (6)
  • js/app/packages/service-clients/service-email/openapi.json
  • rust/cloud-storage/email_service/src/bin/pubsub_workers/pubsub_workers.rs
  • rust/cloud-storage/email_service/src/pubsub/sfs_uploader/context.rs
  • rust/cloud-storage/email_service/src/pubsub/sfs_uploader/process.rs
  • rust/cloud-storage/email_service/src/pubsub/sfs_uploader/worker.rs
  • rust/cloud-storage/models_email/src/email/api/refresh.rs

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Inbox now automatically refreshes when your profile photo upload completes, making the updated photo immediately visible in your inbox.

Walkthrough

The PR adds a PhotoSynced { link_id: Uuid } variant to the RefreshEmailEvent enum and mirrors it as a photo_synced oneOf entry in the OpenAPI spec. A ConnectionGatewayClient field is added to SFSUploaderContext, and run_worker's signature is extended to accept and wire in this client. The pubsub worker startup clones the client and passes it to run_worker. In process_message, after a successful contact upsert, a new notify_if_self_contact helper is called; it fetches the link by link_id, compares the contact email to the link's inbox email case-insensitively, and emits cg_refresh_email with RefreshEmailEvent::PhotoSynced { link_id } only when they match.

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title follows conventional commits format with 'feat:' prefix but exceeds the 72-character limit at 76 characters. Reduce the title to 72 characters or fewer while preserving the conventional commits format and core meaning, such as 'feat(email): emit photo_synced event on self-contact photo upload'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the change: moving avatar polling to WebSocket signal emission via PhotoSynced event, gated for self-contact uploads only.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

@gbirman gbirman merged commit 1108c76 into main Jun 15, 2026
23 checks passed
@gbirman gbirman deleted the gab/macro-cAXr9fBV8eV72Xw85TcXF-multi-inbox-ws-driven-avatar-fill-in-replace-links-polling branch June 15, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant