docs: document set_peers membership window and wrap test docstrings

This commit is contained in:
Aakash Kattelu 2026-08-24 17:42:30 -04:00
parent 6b3a30c7f2
commit 0ad0e42336
3 changed files with 9 additions and 5 deletions

View File

@ -1050,14 +1050,16 @@ async def set_peers_for_session(
peer_names: dict[str, schemas.SessionPeerConfig],
) -> list[models.SessionPeer]:
"""
Set peers for a session, overwriting any existing peers.
If peers don't exist, they will be created.
Replace a session's ordinary peer set with ``peer_names``.
Active members keep their joined_at and configuration. Departed members
rejoin with the incoming configuration. Scope memberships are preserved.
Args:
db: Database session
workspace_name: Name of the workspace
session_name: Name of the session
peer_names: Set of peer names to set for the session
peer_names: Mapping of peer names to session-level configuration
Returns:
List of SessionPeer objects for all peers in the session

View File

@ -18,7 +18,8 @@ class TestSessionCRUD:
db_session: AsyncSession,
sample_data: tuple[models.Workspace, models.Peer],
):
"""Active re-adds keep joined_at and config; a genuine rejoin starts a new window."""
"""Active re-adds keep joined_at and config; a genuine rejoin starts a
new window."""
test_workspace, test_peer = sample_data
session_name = str(generate_nanoid())
original_config = schemas.SessionPeerConfig(

View File

@ -711,7 +711,8 @@ async def test_grep_messages_observer_scoping_left_session_still_visible(
async def test_peer_perspective_search_after_active_readd(
db_session: AsyncSession,
):
"""Active re-add keeps existing messages visible; a genuine rejoin starts a new window."""
"""Active re-add keeps existing messages visible; a genuine rejoin starts a
new window."""
workspace = models.Workspace(name=generate_nanoid())
peer1 = models.Peer(name="peer1", workspace_name=workspace.name)
peer2 = models.Peer(name="peer2", workspace_name=workspace.name)