-
Notifications
You must be signed in to change notification settings - Fork 340
refactor: performance, recording consistency, and quote logic fixes #1108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
refactor: performance, recording consistency, and quote logic fixes #1108
Conversation
…ecording consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR optimizes performance and fixes consistency issues in the recording functionality and permission handling.
Changes:
- Fixed a typo (
toogleRecordingMessage→toggleRecordingMessage) and integrated video recording state management to match audio recording behavior - Optimized permission memoization to prevent unnecessary re-renders
- Improved role processing performance from O(N²) to O(N) and added null-safety to admin username mapping
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/react/src/views/ChatInput/VideoMessageRecoder.js | Added toggleRecordingMessage calls to synchronize global recording state, ensuring UI elements are properly disabled during video recording |
| packages/react/src/views/ChatInput/AudioMessageRecorder.js | Fixed typo in function name from toogleRecordingMessage to toggleRecordingMessage |
| packages/react/src/store/messageStore.js | Fixed typo in store method name from toogleRecordingMessage to toggleRecordingMessage |
| packages/react/src/hooks/useFetchChatData.js | Fixed permission memoization by storing raw permissions, optimized roles reduce from O(N²) to O(N), and added null-safety for admin usernames mapping |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ChatBody, and fix emoji insertion at cursor
… authentication, commands, and message tools
Problem
rawpermission object was missing its reference point.2.Efficiency: The member role reduction logic was using an immutable spread pattern inside a reduce, leading to O(N^2) complexity.
isRecordingMessagestate, allowing users to still interact with the chat input while recording.toogleRecordingMessage) led to inconsistencies across hooks.Solution
permissionsRef.current.rawto ensure the early-exit logic works, preventing redundant state updates.roles.reducelogic for O(N) performance.Testing
npm run build).