feat(files): improve editor recovery and editing controls - #7519
feat(files): improve editor recovery and editing controls#7519waleedlatif1 wants to merge 9 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Greptile SummaryThis PR strengthens collaborative file editing across browser recovery, Redis-backed relay coordination, durable outbox reconciliation, and graceful shutdown. It also expands rich Markdown editing controls and preserves image, link, selection, and formatting behavior across collaborative updates.
Confidence Score: 5/5The PR appears safe to merge based on the reviewed code, with all previous findings resolved and no actionable new failures identified. The latest changes correctly keep pending joins out of content-bearing rooms until final authorization, preserve invalidation delivery through a separate admission room, and drain tracked disconnect cleanup before releasing Redis-backed dependencies. The earlier Redis replay, recovery, image handling, link selection, formatting-policy, comment-style, and authorization findings are resolved or withdrawn.
|
| Filename | Overview |
|---|---|
| apps/realtime/src/handlers/file-doc.ts | Delays document-room membership until final authorization and uses a separate invalidation-only admission room. |
| apps/realtime/src/handlers/file-doc-store.ts | Implements generation-fenced Redis replay, atomic append and compaction, acknowledged-update deduplication, and bounded stream processing. |
| apps/realtime/src/handlers/connection.ts | Tracks asynchronous disconnect cleanup so shutdown can wait for presence removal. |
| apps/realtime/src/index.ts | Reorders graceful shutdown to flush documents, close transports, drain cleanup, and then release Redis dependencies. |
| apps/realtime/src/routes/http.ts | Fans document invalidations out to both admitted editors and pending admission rooms. |
| apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/collaboration/file-doc-provider.ts | Adds acknowledged-update recovery, reconnect handling, generation validation, and terminal-state behavior. |
| apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/collaboration/pending-update-journal.ts | Provides bounded IndexedDB recovery with validation, quarantine, and identity-safe acknowledgement. |
| apps/sim/lib/core/outbox/service.ts | Extends transactional outbox processing for durable file-document reconciliation. |
| packages/realtime-protocol/src/file-doc.ts | Extends the shared file-document protocol for readiness, acknowledgements, generation identity, and invalidation. |
Sequence Diagram
sequenceDiagram
participant B as Browser editor
participant R as Realtime relay
participant S as Redis stream
participant A as App outbox consumer
participant D as Durable file storage
B->>R: Authenticate and request file join
R->>R: Resolve initial authorization
R->>S: Hydrate document and verify generation
R->>R: Resolve final authorization
R-->>B: Join content room and synchronize Yjs state
B->>R: Send acknowledged collaborative update
R->>S: Atomically append and deduplicate update
R-->>B: Acknowledge accepted update
R->>A: Request durable reconciliation
A->>D: Persist projected Markdown
A->>R: Deliver versioned invalidation/reconciliation
R->>S: Fence stale generations
R-->>B: Continue with current generation or rejoin
Reviews (9): Last reviewed commit: "fix(files): authorize joins before subsc..." | Re-trigger Greptile
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
Type of Change
Testing
Checklist