miurla / morphic

An AI-powered search engine with a generative UI
https://morphic.sh
Apache License 2.0
6.23k stars 1.6k forks source link

[BUG] Answer Section rerenders and show loader when Related Section is streaming and showing loader #343

Open mhshahidf opened 1 month ago

mhshahidf commented 1 month ago

Is there an existing issue for this?

Vercel Runtime Logs

Current Behavior

On the Search page when Answer Section has finished loading and the Related Section is streaming it also rerenders and show loader on Answer section.

Expected Behavior

Only the current streaming section should show the loader.

Steps To Reproduce

  1. Write a prompt, Submit and go to Search page.
  2. Wait for the Search Related section to start loading
  3. You will see the Answer Section also shows the loader.

Environment

- OS: Mac
- Browser: Chrome

Anything else?

Screenshot 2024-09-24 at 1 49 29 AM

Please let me know if anyone is facing or had faced this issue and what was the solution to it. I already looked into the AnswerSection and SearchRelated sections component and other required components but didn't found the issue. Streaming code base Seems confusing.

miurla commented 2 weeks ago

The re-rendering issue is related to the current implementation of AI SDK RSC. We are planning a migration: https://github.com/miurla/morphic/issues/368

This issue should be resolved once the migration is completed.