Collaboration refinements: require HocuspocusProvider, context-aware error messages#22564
Open
Collaboration refinements: require HocuspocusProvider, context-aware error messages#22564
Conversation
Deploying openproject with ⚡ PullPreview
|
3 tasks
…are error messages Extract non-IndexedDB refinements from PR #22125 so they can ship independently while IndexedDB offline persistence is evaluated separately. - Gate collaboration on Setting.real_time_text_collaboration_enabled? instead of hardcoding it to true - Remove the test-mode fallback that created a standalone Y.Doc without a provider; HocuspocusProvider is now required for document editing - Refactor useCollaboration hooks: callback-based timeout with proactive cancel on sync, extracted useProviderAuthError hook, JSDoc comments - Add read/write context-aware connection error messages (readonly users see "real-time updates will resume" vs writers see "changes will sync") - Add blocked offline mode: when the server is unreachable and there is no local cache, hide the editor entirely to prevent an empty Y.Doc from being synced as authoritative content on reconnect - Update feature specs to use real hocuspocus shared context instead of stubbing collaboration_enabled, add offline blocking tests
85ade6d to
8272768
Compare
--------- Co-authored-by: Kabiru Mwenja <k.mwenja@openproject.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket
https://community.openproject.org/work_packages/72665
What are you trying to accomplish?
This extracts the non-IndexedDB refinements from #22125 so they can ship independently while we evaluate IndexedDB offline persistence (encryption at rest concern) separately.
The changes clean up the collaboration architecture by removing the test-mode fallback path, making HocuspocusProvider mandatory, and improving the offline/error UX with context-aware messages.
Key changes:
Setting.real_time_text_collaboration_enabled?instead of being hardcoded onuseCollaborationhooks are refactored with callback-based timeout, proactive cancel on sync, extracteduseProviderAuthErrorhook, and JSDoccollaboration_enabledWhat approach did you choose and why?
Rather than cherry-picking interleaved commits from #22125, each file was manually crafted to include only non-IndexedDB changes. The
blockingOfflineconcept from the full PR collapses here — without IndexedDB there is no local cache, so all offline is blocking. The IndexedDB branch will later rebase on top of this one, re-introducinghasCachedDocument, soft offline mode, and they-indexeddbdependency.Merge checklist