Skip to content

Add client-side timeout to pro_bind_tenant/ListTenantMemberships - #2558

Merged
mstomar125 merged 1 commit into
mainfrom
issue-2556-pro-bind-tenant-timeout
Sep 10, 2026
Merged

mstomar125 merged 1 commit into
mainfrom
issue-2556-pro-bind-tenant-timeout

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Summary

Fixes #2556. Both pro_bind_tenant and ListTenantMemberships (packages/desktop-app/src-tauri/src/commands/pro_sync.rs) had no client-side timeout, unlike WatchSyncStatusRequest's existing tokio::time::timeout pattern (SUBSCRIBE_TIMEOUT). Wraps both calls in the same shape with a new MEMBERSHIP_RPC_TIMEOUT constant (5s, matching SUBSCRIBE_TIMEOUT), mapping an elapsed timeout to an Err(String) the same way an RPC failure already is.

This matters most for pro_bind_tenant: the add-synced-database dialog's binding step (added in #2541/PR#2555) blocks every dismiss path for the call's duration, so a hang without a bound left it stuck with no way out. The dialog's existing confirmBind/loadTenants catch blocks already route any invoke() rejection to its generic error step, so the timeout's Err surfaces there with no frontend change needed.

Test plan

  • bun run test:all green (full frontend + Rust workspace, including the real mcp_integration end-to-end suite)
  • cargo clippy --all-targets -- -D warnings clean
  • Push independently verified via local/remote SHA match

Both RPCs rode the lazy Pro gRPC channel with no bound on how long a
wedged daemon call could hang, unlike WatchSyncStatusRequest's existing
tokio::time::timeout pattern (SUBSCRIBE_TIMEOUT). Wrap both calls in the
same tokio::time::timeout shape with a new MEMBERSHIP_RPC_TIMEOUT
constant (5s, matching SUBSCRIBE_TIMEOUT), mapping an elapsed timeout to
an Err(String) the same way an RPC failure already is.

This matters most for pro_bind_tenant: the add-synced-database dialog's
'binding' step blocks every dismiss path for the call's duration, so a
hang without a bound left it stuck with no way out. The dialog's
existing confirmBind/loadTenants catch blocks already route any
invoke() rejection to its generic error step, so the timeout's Err
surfaces there with no frontend change needed.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@mstomar125
mstomar125 merged commit 4c5b9b5 into main Sep 10, 2026
@mstomar125
mstomar125 deleted the issue-2556-pro-bind-tenant-timeout branch September 10, 2026 12:08
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.

pro_bind_tenant/ListTenantMemberships have no client-side timeout — a stuck daemon call leaves the add-synced-database dialog undismissable

1 participant