Rename InitPayload team_uid to share_with_team_uid - #76
Conversation
Session create needs the initiating view's team so warp-server can grant the initial team guest ACL to that team instead of GetTeamForPrincipal's lowest numeric team ID. Older payloads omit the field.
|
This PR was generated with Warp. Comment |
|
@warp-agent-staging[bot] I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds an optional team_uid to the sharer InitPayload and adds serde coverage for omitted and present values. The wire-format change is optional, and no approved spec context was available for additional spec-drift validation.
Concerns
- Adding
team_uidas a new field on a public Rust struct is not source-compatible for downstream callers that constructInitPayloadwith a struct literal, even though the serde representation is backward-compatible.
Verdict
Found: 0 critical, 1 important, 0 suggestions
Request changes
Comment /warp-agent-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
The field grants initial viewer access to a team and does not change session ownership. firebase_uid remains the owner identity.
Omission is not "no initial team share": the server keeps selecting the owner's default team for initial viewer access.
#15631) ## Description Resolve the initiating selected view's `TeamScope` into sharer `InitPayload.share_with_team_uid` so session create can grant the initial team guest ACL to that team. The field does not change session ownership. Client `Option<String>` already preserves presence: - `None` (personal/unscoped views): proto field omitted; server uses legacy default-team fallback - `Some(uid)` (team-scoped views): proto field present; server authorizes that team - `Some("")` is not sent by this client; if present, warp-server authorizes empty and fails rather than falling back ## Linked Issue - Related: warpdotdev/warp-server#16262 - [ ] The linked issue is labeled `ready-to-spec` or `ready-to-implement`. - [ ] Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes). ## Protocol pin warpdotdev/session-sharing-protocol#76 is squash-merged. This PR pins `session-sharing-protocol` to `fcd0fea35ab9f782043c8ec74fd81bce187ded9f` on `main`. Also depends on warp-server and session-sharing-server landing so create actually uses the payload team. ## Testing - `cargo test -p warp --lib -- test_share_with_team_uid_for_init_payload` - `cargo metadata --locked` - [ ] I have manually tested my changes locally with `./script/run` ### Screenshots / Videos End-to-end visual proof of a session started from a non-default team is blocked until warp-server and SSS land together. This environment has no computer-use/GUI, and a live share against current production/staging servers would still hit the old create path. Strongest valid proof available now: unit tests that a team-scoped view puts the selected team UID on `InitPayload.share_with_team_uid` and a personal view omits it. ACL persistence is covered on warp-server by `TestCreateSharedSessionUsesAuthorizedNonLowestTeamGuest`. ## Agent Mode - [ ] Warp Agent Mode - This PR was created via Warp's AI Agent Mode CHANGELOG-NONE <!-- warp:pr-description-artifacts start --> <!-- warp:pr-description-artifacts end --> --------- Co-authored-by: warp-agent-staging[bot] <240773466+warp-agent-staging[bot]@users.noreply.github.com>



Summary
Add optional
share_with_team_uidon sharerInitPayloadso session create can grant the initial team guest ACL to the initiating view's team. The field does not change session ownership;firebase_uidremains the owner identity. If omitted, the server preserves legacy behavior by selecting the owner's default team for initial viewer access.Related to https://github.com/warpdotdev/warp-server/issues/16262
Changes
InitPayload.share_with_team_uidwith backward-compatible serde (default, omitNone)None, andSomepayloadsRust API compatibility
Wire format is backward compatible. Adding a public field is a Rust source break for
InitPayload { ... }literals.Known constructors:
warpsharerNetwork(Send initiating view share_with_team_uid in shared session InitPayload warp#15631) — the only production constructor; updated in lockstepsession-sharing-serverdeserializes the payload; it does not construct the structInitPayloadis a different type and is unchangedwarp-internalmirrors the warp constructor and picks up #15631 via repo-sync after that PR landsDo not bump other protocol pins until warp#15631 (or the matching internal sync) includes
share_with_team_uid. No crate version/API workaround; lockstep is the intended landing.Verification
cargo test --lib:init_payload_deserializes_missing_share_with_team_uid_as_none,init_payload_omits_none_share_with_team_uid_and_round_trips_some