fix(web): Ask sourcebot perf improvements - #632
Conversation
This comment has been minimized.
This comment has been minimized.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
8ad6960 to
da3c93e
Compare
|
@coderabbitai A user has raised that they are hitting a 404 error when getting redirected to localhost:3000/~/chat/. I believe this is a regression that was introduced in this PR. Please find the issue. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 1589 🏁 Script executed: Length of output: 87353 @brendan-kellam I found the regression! The issue is that several client-side navigation calls were changed to use the hardcoded Root CauseThe Next.js app structure uses Affected Files1. // BEFORE (correct):
const url = createPathWithQueryParams(`/${domain}/chat/${response.id}`);
// AFTER (broken):
const url = createPathWithQueryParams(`/${SINGLE_TENANT_ORG_DOMAIN}/chat/${response.id}`);2. // Multiple instances where navigation now uses SINGLE_TENANT_ORG_DOMAIN:
router.push(`/${SINGLE_TENANT_ORG_DOMAIN}/chat`);
router.push(`/${SINGLE_TENANT_ORG_DOMAIN}/chat/${chat.id}`);3. const url = createPathWithQueryParams(`/${SINGLE_TENANT_ORG_DOMAIN}/search`, ...);4. href={createPathWithQueryParams(`/${SINGLE_TENANT_ORG_DOMAIN}/search`, ...)}5. domain: SINGLE_TENANT_ORG_DOMAIN,SolutionThese files need to be reverted to use Would you like me to create an issue to track this fix? |
@coderabbitai this is not the issue. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 3173 🏁 Script executed: Length of output: 190 🏁 Script executed: Length of output: 86 🏁 Script executed: Length of output: 91 🏁 Script executed: Length of output: 4935 🏁 Script executed: Length of output: 3313 🏁 Script executed: Length of output: 1962 🏁 Script executed: Length of output: 2985 🏁 Script executed: Length of output: 5958 🏁 Script executed: Length of output: 103 🏁 Script executed: Length of output: 133 🏁 Script executed: Length of output: 1037 🏁 Script executed: Length of output: 5626 🏁 Script executed: Length of output: 1366 🏁 Script executed: Length of output: 40 🏁 Script executed: Length of output: 4107 🏁 Script executed: Length of output: 93 🏁 Script executed: Length of output: 54 🏁 Script executed: Length of output: 713 🏁 Script executed: Length of output: 708 🏁 Script executed: Length of output: 2113 🏁 Script executed: Length of output: 49 🏁 Script executed: Length of output: 218 🏁 Script executed: Length of output: 142 🏁 Script executed: Length of output: 220 🏁 Script executed: Length of output: 1568 🏁 Script executed: Length of output: 47 🏁 Script executed: Length of output: 1610 @brendan-kellam I found the actual regression! The issue is an incomplete migration in PR #632. Root CauseThe PR migrated several chat-related server actions from the old Here's what happens:
Why other functions workFunctions like const org = await __unsafePrisma.org.findUnique({
where: {
id: SINGLE_TENANT_ORG_ID, // id = 1
}
});Solution
Would you like me to create an issue to track this fix? |
Improves Ask mode performance by adding memoization in various places + some other optimizations
Fixes #626