Skip to content

Rename InitPayload team_uid to share_with_team_uid - #76

Merged
IsaiahWitzke merged 3 commits into
mainfrom
factory/init-payload-team-uid
Aug 28, 2026
Merged

Rename InitPayload team_uid to share_with_team_uid#76
IsaiahWitzke merged 3 commits into
mainfrom
factory/init-payload-team-uid

Conversation

@warp-agent-staging

@warp-agent-staging warp-agent-staging Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Add optional share_with_team_uid on sharer InitPayload so session create can grant the initial team guest ACL to the initiating view's team. The field does not change session ownership; firebase_uid remains 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

  • Optional InitPayload.share_with_team_uid with backward-compatible serde (default, omit None)
  • Serde coverage for missing, None, and Some payloads
  • Field comment: omission is legacy default-team fallback, not "no team share"

Rust API compatibility

Wire format is backward compatible. Adding a public field is a Rust source break for InitPayload { ... } literals.

Known constructors:

  • This crate's tests
  • warp sharer Network (Send initiating view share_with_team_uid in shared session InitPayload warp#15631) — the only production constructor; updated in lockstep
  • session-sharing-server deserializes the payload; it does not construct the struct
  • Viewer InitPayload is a different type and is unchanged
  • warp-internal mirrors the warp constructor and picks up #15631 via repo-sync after that PR lands

Do 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

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.
@warp-agent-staging

Copy link
Copy Markdown
Contributor Author

This PR was generated with Warp.

Comment @warp-factory on this PR to send it follow-up work.

View run View conversation View on Slack

@warp-for-oss

warp-for-oss Bot commented Aug 28, 2026

Copy link
Copy Markdown

@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 /warp-agent-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@warp-for-oss warp-for-oss Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_uid as a new field on a public Rust struct is not source-compatible for downstream callers that construct InitPayload with 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

Comment thread src/sharer.rs Outdated
The field grants initial viewer access to a team and does not change
session ownership. firebase_uid remains the owner identity.
@warp-agent-staging warp-agent-staging Bot changed the title Add optional team_uid to sharer InitPayload Rename InitPayload team_uid to share_with_team_uid Aug 28, 2026
Omission is not "no initial team share": the server keeps selecting
the owner's default team for initial viewer access.
@IsaiahWitzke
IsaiahWitzke merged commit fcd0fea into main Aug 28, 2026
5 checks passed
@IsaiahWitzke
IsaiahWitzke deleted the factory/init-payload-team-uid branch August 28, 2026 14:20
IsaiahWitzke pushed a commit to warpdotdev/warp that referenced this pull request Aug 28, 2026
#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>
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