From 92fce9ea04afdc07acfc0f3a6bdfaacd65a9cb5d Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 2 Jul 2025 22:07:38 -0700 Subject: [PATCH] faster maybe (#1606) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # READ CAREFULLY THEN REMOVE Remove bullet points that are not relevant. PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI. - Pull requests that do not follow these guidelines will be closed without review or comment. - If you use AI to write your PR description your pr will be close without review or comment. - If you are unsure about anything, feel free to ask for clarification. ## Description Please provide a clear description of your changes. --- ## Type of Change Please delete options that are not relevant. - [ ] 🐛 Bug fix (non-breaking change which fixes an issue) - [ ] ✨ New feature (non-breaking change which adds functionality) - [ ] 💥 Breaking change (fix or feature with breaking changes) - [ ] 📝 Documentation update - [ ] 🎨 UI/UX improvement - [ ] 🔒 Security enhancement - [ ] ⚡ Performance improvement ## Areas Affected Please check all that apply: - [ ] Email Integration (Gmail, IMAP, etc.) - [ ] User Interface/Experience - [ ] Authentication/Authorization - [ ] Data Storage/Management - [ ] API Endpoints - [ ] Documentation - [ ] Testing Infrastructure - [ ] Development Workflow - [ ] Deployment/Infrastructure ## Testing Done Describe the tests you've done: - [ ] Unit tests added/updated - [ ] Integration tests added/updated - [ ] Manual testing performed - [ ] Cross-browser testing (if UI changes) - [ ] Mobile responsiveness verified (if UI changes) ## Security Considerations For changes involving data or authentication: - [ ] No sensitive data is exposed - [ ] Authentication checks are in place - [ ] Input validation is implemented - [ ] Rate limiting is considered (if applicable) ## Checklist - [ ] I have read the [CONTRIBUTING](https://github.com/Mail-0/Zero/blob/staging/.github/CONTRIBUTING.md) document - [ ] My code follows the project's style guidelines - [ ] I have performed a self-review of my code - [ ] I have commented my code, particularly in complex areas - [ ] I have updated the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix/feature works - [ ] All tests pass locally - [ ] Any dependent changes are merged and published ## Additional Notes Add any other context about the pull request here. ## 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** * Increased the maximum number of requests that can be batched together, potentially improving performance and reducing network overhead for users. --- apps/mail/app/root.tsx | 2 +- apps/mail/lib/trpc.server.ts | 2 +- apps/mail/providers/query-provider.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/mail/app/root.tsx b/apps/mail/app/root.tsx index 22acfdacd..c36afb273 100644 --- a/apps/mail/app/root.tsx +++ b/apps/mail/app/root.tsx @@ -32,7 +32,7 @@ export const getServerTrpc = (req: Request) => createTRPCClient({ links: [ httpBatchLink({ - maxItems: 1, + maxItems: 8, url: getUrl(), transformer: superjson, headers: req.headers, diff --git a/apps/mail/lib/trpc.server.ts b/apps/mail/lib/trpc.server.ts index 78a5b127a..6210a468a 100644 --- a/apps/mail/lib/trpc.server.ts +++ b/apps/mail/lib/trpc.server.ts @@ -8,7 +8,7 @@ export const getServerTrpc = (req: Request) => createTRPCClient({ links: [ httpBatchLink({ - maxItems: 1, + maxItems: 8, url: getUrl(), transformer: superjson, headers: req.headers, diff --git a/apps/mail/providers/query-provider.tsx b/apps/mail/providers/query-provider.tsx index 2c0f42995..0e498c178 100644 --- a/apps/mail/providers/query-provider.tsx +++ b/apps/mail/providers/query-provider.tsx @@ -90,7 +90,7 @@ export const trpcClient = createTRPCClient({ transformer: superjson, url: getUrl(), methodOverride: 'POST', - maxItems: 1, + maxItems: 8, fetch: (url, options) => fetch(url, { ...options, credentials: 'include' }).then((res) => { const currentPath = new URL(window.location.href).pathname;