ItzCrazyKns / Perplexica

Perplexica is an AI-powered search engine. It is an Open source alternative to Perplexity AI
MIT License
10.67k stars 931 forks source link

βœ… feat: implemented error state for backend socket connection and oth… #193

Closed asifrahaman13 closed 6 days ago

asifrahaman13 commented 2 weeks ago

The spinner on the home page keeps rolling in case there is a fault from the backend.

🚨 Problem:

  1. If the backend is not running
  2. If there is some error in the connection.

misconfiguration

πŸͺœ Steps to reproduce:

  1. Clone the repository.
  2. Run the front end withoug the backend.
  3. Or do not give proper Opne AI API key.
  4. Sometimes the problem persists due to mi configurations in the local storage. In this case if we run even both front end as well as backend even then the issue persists.

βœ… Solution:

I have introduced another state hasError which keeps track of whether there is any error in the conection. In case there is erro UI will display error message along with the toast. So backend won't be blocker.

failed message

@ItzCrazyKns

Ed-cred commented 6 days ago

This looks like a nice quality of life change for the user experience, but if you want this to be considered for merging you probably need to ammend this commit and remove all of the package-lock and yarn lock files from it.

ItzCrazyKns commented 6 days ago

I think you didn't have to remove the entire package lock files...

asifrahaman13 commented 6 days ago

@ItzCrazyKns

hey please let me know if anything else nees to be done for the merge

ItzCrazyKns commented 6 days ago

@ItzCrazyKns

hey please let me know if anything else nees to be done for the merge

You need to bring pack the package files and uncommit them.