Z0R-603 anonymous guest cursors#14878
Conversation
Merge anonymous board access via PR #3.
Wrap anonymous board editor in the same Scrollable.Viewport contract used by detail/share pages.
fix: show tools on anonymous boards
Fix anonymous board blob loading
fix: restrict anonymous deletes to own content
fix: document local affine deploy
Add scoped access tokens
Bundle server native x64 fallback
Disable automatic fork image builds
fix: ignore existing anonymous doc delete ranges
fix: allow anonymous image upload updates
Recognize real image upload Yjs updates that store bare blob source ids, and add the local full-test-cycle skill.
Detect image upload markers across the whole Yjs update and cover split image/source structs.
…sed-blobs Fix anonymous content-addressed blob uploads
…e-ranges Fix anonymous template delete ranges
Fix anonymous derived object ownership
|
|
|
Opened against upstream by mistake; this fork-specific production change is being handled in z0rgoyok/AFFiNE. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (74)
Disabled knowledge base sources:
📝 WalkthroughWalkthroughThis PR introduces anonymous document access functionality to AFFiNE, enabling guest access to shared documents through token-based links. Changes include backend services and database migrations for guest sessions/access links, scoped access tokens, GraphQL mutations/queries for link management, cloud storage/sync gateway support for anonymous guests, a frontend anonymous board page, and operational deployment documentation. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Frontend Client
participant Resolver as GraphQL Resolver<br/>(resolveAnonymousDocAccessLink)
participant Service as AnonymousDocAccessService
participant DB as Database
participant Gateway as Sync Gateway
participant Storage as Cloud Storage
Client->>Resolver: resolveAnonymousDocAccessLink(token, displayName)
Resolver->>Service: resolveLink(token)
Service->>DB: Query anonymousDocAccessLink by token hash
DB-->>Service: Link record (enabled, not revoked)
Service->>DB: Create/fetch anonymousDocGuestSession
DB-->>Service: Guest session with guestToken
Service-->>Resolver: {guestToken, link, guest}
Resolver-->>Client: guestToken + link metadata
Client->>Gateway: WebSocket connect with anonymousGuestToken
Gateway->>Service: Validate guest token
Service->>DB: Verify guestToken hash & link status
DB-->>Service: Valid guest principal
Service-->>Gateway: Guest principal established
Gateway-->>Client: Authenticated as anonymous guest
Client->>Gateway: space:join (workspace/doc)
Gateway->>Service: assertCanAccessDoc(guest, docId)
Service-->>Gateway: Access allowed
Gateway->>Storage: Load workspace sync state
Storage-->>Gateway: Initial sync state
Gateway-->>Client: Doc state synced
Client->>Gateway: space:push-doc-update (Yjs update)
Gateway->>Service: assertUpdatesDeleteOnlyGuestContent(update)
Service->>Service: Validate struct deletions (analyze Yjs ranges)
Service-->>Gateway: Update allowed/denied
Gateway->>DB: recordUpdates(guestSessionId, update)
DB-->>Gateway: Update recorded
Gateway-->>Client: Update applied
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Implements anonymous guest themed names and visible cursors for anonymous boards.\n\nChecks run locally:\n- yarn affine @affine/server ava src/core/anonymous-doc-access/tests/service.spec.ts --serial --concurrency 1\n- yarn lint:ox changed files\n- yarn eslint changed files\n- yarn prettier --check changed files\n- yarn typecheck\n- local Playwright two anonymous sessions on non-standard ports 58719/58711
Summary by CodeRabbit
New Features
Bug Fixes
Documentation