fix: reduced useSession() calls ; layout inconsistencies #432
fix: reduced useSession() calls ; layout inconsistencies #432nizzyabi merged 1 commit intoMail-0:stagingfrom
Conversation
|
@John-Kiruba is attempting to deploy a commit to the Zero Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe changes refactor how session data is managed and passed within the mail components. In the mail list file, the session is now memoized and provided as a prop to the Thread component instead of being accessed directly, with associated adjustments to optimize performance using hooks like Changes
Sequence Diagram(s)sequenceDiagram
participant ML as MailList
participant UM as useMemo (Session Data)
participant T as Thread Component
ML->>UM: Compute sessionData (userId, connectionId)
UM-->>ML: Return memoized sessionData
ML->>T: Pass sessionData via props
T->>T: Use sessionData for prefetch and rendering logic
Possibly related PRs
Suggested reviewers
Poem
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🔇 Additional comments (9)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
LGTM, @ahmetskilinc can you double check this |
ahmetskilinc
left a comment
There was a problem hiding this comment.
@nizzyabi all good. checked locally.
Description
MailList comp has useSession() data call and its child Thread comp does the same; the issue is Thread renders virtual items and during stale revalidation --- i assume ,(even though its memoized) it makes multiple GET /api/auth/get-session for virtual items. this is reduced my passing only the required session data as props to the threads component.
Layout

fixed
Type of Change
Please delete options that are not relevant.
Areas Affected
Please check all that apply:
Testing Done
Describe the tests you've done:
Security Considerations
For changes involving data or authentication:
Checklist
Additional Notes
apart form cold start in local dev, the app (virtual rendering is lag free. Kindly comment if any issues persists from my pr, happy to look into it
Screenshots/Recordings
Add screenshots or recordings here if applicable.
By submitting this pull request, I confirm that my contribution is made under the terms of the project's license.
Summary by CodeRabbit
Refactor
Chores