Draft
Conversation
This reverts commit 9990e35.
- [x] Linked issue added (e.g., `Fixes #123`) - [x] I have run `bun run format` to ensure code is properly formatted - [x] I have verified that `bun run lint` passes without errors - [ ] If blog post was added: - [ ] Ensure images have been optimised - [ ] Update dates to reflect the actual publishing date when merged (file names, folder names, and frontmatter) **Summary** Implements concurrent editing protection for Strapi CMS by installing and configuring Record Locking plugin with takeover functionality. This prevents data loss when multiple users attempt to edit the same content simultaneously. **Features Added** - **Record Locking**: Only one user can edit a content entry at a time - **Takeover Feature**: Allows users to forcefully take over editing from another user - **Real-time Updates**: WebSocket-based live status updates across browser sessions - **Visual Indicators**: Clear messaging showing who is currently editing content **How It Works** **Normal Editing Flow** 1. User A clicks "Edit" on any content entry 2. Record Locking plugin checks if content is locked 3. If unlocked, plugin creates lock for User A in database 4. WebSocket broadcasts lock event to all connected users 5. User A can now edit the content exclusively **Takeover Scenario** 1. User B tries to edit content already locked by User A 2. Plugin displays warning: "This entry is being edited by [User A name]" <img width="914" height="289" alt="Screenshot 2026-01-20 at 3 42 10 PM" src="https://github.com/user-attachments/assets/4f3d8930-700d-4643-9952-72400208eab9" /> 4. "Takeover" button appears next to warning 5. User B clicks takeover → lock transfers from User A to User B 6. User A receives notification that they lost edit access <img width="932" height="287" alt="Screenshot 2026-01-20 at 3 42 40 PM" src="https://github.com/user-attachments/assets/ee5e9878-9162-4b3a-86be-b30ec4524551" /> 8. Real-time WebSocket updates ensure both users see status change immediately **Changes Made** **Core Implementation:** - Installed `@notum-cz/strapi-plugin-record-locking` v2.1.0 - Configured plugin with takeover button enabled (`showTakeoverButton: true`) - Set WebSocket transport for real-time updates (`transports: ['websocket']`) - Updated Content Security Policy to allow WebSocket connections (`ws:`, `wss:`) **Files Modified:** - `cms/package.json` - Added record-locking dependency - `cms/config/plugins.ts` - Plugin configuration with takeover enabled - `cms/config/middlewares.ts` - WebSocket support in CSP headers **Code Quality:** - Updated ESLint configuration - Applied project-wide code formatting - Regenerated TypeScript definitions **Testing Instructions** 1. **Setup**: Create two admin accounts in Strapi admin panel 2. **Session 1**: Open browser with User 1, go to Content Manager 3. **Session 2**: Open incognito/private window with User 2, go to same page 4. **Test Lock**: User 1 edits any blog post → content becomes locked to them 5. **Test Warning**: User 2 tries to edit same post → sees lock warning with User 1's name 6. **Test Takeover**: User 2 clicks "Takeover" button → gains edit access, User 1 loses it 9. **Verify Real-time**: Both users see lock status change immediately without page refresh --------- Co-authored-by: Jonathan Matthey <mattheyj@gmail.com>
✅ Deploy Preview for developers-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…stomclasses # Conflicts: # cms/src/admin/app.tsx # cms/src/api/blog-post/content-types/blog-post/lifecycles.ts # cms/src/index.ts
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.
PR Checklist
Fixes #123)bun run formatto ensure code is properly formattedbun run lintpasses without errorsSummary