Repository navigation
Add client-side timeout to pro_bind_tenant/ListTenantMemberships - #2558
Merged
Merged
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2556. Both
pro_bind_tenantandListTenantMemberships(packages/desktop-app/src-tauri/src/commands/pro_sync.rs) had no client-side timeout, unlikeWatchSyncStatusRequest's existingtokio::time::timeoutpattern (SUBSCRIBE_TIMEOUT). Wraps both calls in the same shape with a newMEMBERSHIP_RPC_TIMEOUTconstant (5s, matchingSUBSCRIBE_TIMEOUT), mapping an elapsed timeout to anErr(String)the same way an RPC failure already is.This matters most for
pro_bind_tenant: the add-synced-database dialog'sbindingstep (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 existingconfirmBind/loadTenantscatch blocks already route anyinvoke()rejection to its generic error step, so the timeout'sErrsurfaces there with no frontend change needed.Test plan
bun run test:allgreen (full frontend + Rust workspace, including the realmcp_integrationend-to-end suite)cargo clippy --all-targets -- -D warningsclean