Skip to content

chore: simplify mail bridge life cycle - #1505

Merged
AlexisMora merged 1 commit into
feature/mail-bridgefrom
refactor/mail-bridge-simplifcation
Sep 18, 2026
Merged

AlexisMora merged 1 commit into
feature/mail-bridgefrom
refactor/mail-bridge-simplifcation

Conversation

@AlexisMora

@AlexisMora AlexisMora commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

What is Changed / Added

Replaces the previous Mail Bridge manager/state lifecycle with focused, functional services.
Desktop now separates:

  • Process concerns: resolve the Bridge executable, create the per-account state directory, spawn the child process, and capture sanitized startup stderr.
  • Startup concerns: wait for the private control connection and Bridge ready response, with a 30-second timeout and child exit/error handling.
  • Resource cleanup: destroy the control socket, close the private control server, and terminate the child process.
  • Lifecycle ownership: expose start, stop, current status, and status subscriptions from one Desktop service.

The new lifecycle service also coalesces concurrent start requests: a second activation waits for the first startup operation rather than starting another Bridge process.

Behaviour

  • Starts the Bridge through a private named-pipe control endpoint.
  • Sends start_session only after the Bridge connects.
  • Returns actual local IMAP/SMTP settings after ready.
  • Surfaces startup failures.
  • Stops resources on startup failures, logout, app quit, and explicit turn-off.
  • Handles child-process and control-channel failures as lifecycle errors.

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: e61962f0-9189-4932-ab57-b47945ddc784

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions

Copy link
Copy Markdown

This PR changes 737 lines.

If it contains multiple concerns, consider splitting it. Large PRs are fine when the changes are mechanical, intentionally grouped, or belong together as part of the same feature.

Please make sure the PR description gives reviewers enough context about what matters most to review.

@AlexisMora
AlexisMora marked this pull request as ready for review September 16, 2026 18:38
@AlexisMora
AlexisMora added this pull request to stack #1507 September 16, 2026 18:48
@AlexisMora
AlexisMora merged commit 731a98c into feature/mail-bridge Sep 18, 2026
3 of 6 checks passed
@AlexisMora
AlexisMora deleted the refactor/mail-bridge-simplifcation branch September 18, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants