Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] v1.41.0 更新後如果已經是登入狀態,再點選登出就會卡在"用戶狀態初始化" #5221

Open
Sen-CaPoo opened this issue Dec 29, 2024 · 15 comments
Labels
🐛 Bug Something isn't working | 缺陷

Comments

@Sen-CaPoo
Copy link

📦 Environment

Docker

📌 Version

v1.41.0

💻 Operating System

Windows

🌐 Browser

Chrome

🐛 Bug Description

v1.41.0 更新後如果已經是登入狀態,再點選登出就會卡在應用剛開啟時的讀取畫面"用戶狀態初始化...",重開依然如此,刪除 cookie 後依然無法打開。

📷 Recurrence Steps

No response

🚦 Expected Behavior

No response

📝 Additional Information

No response

@Sen-CaPoo Sen-CaPoo added the 🐛 Bug Something isn't working | 缺陷 label Dec 29, 2024
@github-project-automation github-project-automation bot moved this to Roadmap - Chat 1.x in Lobe Chat Routine Dec 29, 2024
@lobehubbot
Copy link
Member

👀 @Sen-CaPoo

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

Copy link

dosubot bot commented Dec 29, 2024

The issue you're experiencing seems to be related to the logout process in version v1.41.0, where the application gets stuck on the "user state initialization" screen after logging out. Unfortunately, I couldn't find specific changes in version v1.41.0 that might directly affect the logout process or user state initialization. However, here are a few things you might consider checking or trying:

  1. Session State Management: Ensure that the session state is being correctly reset or cleared upon logout. The application uses a handleClear function to clear session data, plugins, topics, files, messages, and session groups [1].

  2. Logout Functionality: Verify that the logout function is working as expected. It should handle different authentication providers like Clerk and NextAuth, ensuring that the appropriate sign-out methods are called [2][3].

  3. Cookie Handling: There have been recent changes related to cookie handling, such as refactoring cookies and headers to an asynchronous mode, which might affect how cookies are managed [4][5].

If these suggestions do not resolve the issue, you might need to investigate further into the specific changes made in version v1.41.0 or consider reaching out to the development team for more detailed support.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@arvinxx
Copy link
Contributor

arvinxx commented Dec 29, 2024

我测试下来是正常的呀?能否给出更加具体的复现情况?例如是怎么部署的,最好能有录屏看下

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Is it normal after my test? Can you give a more specific reproduction situation? For example, how is it deployed? It would be best to have a screen recording to see.

@Sen-CaPoo
Copy link
Author

Sen-CaPoo commented Dec 29, 2024

我测试下来是正常的呀?能否给出更加具体的复现情况?例如是怎么部署的,最好能有录屏看下

目前退回上一版 v1.36.30 正常
重現方法:在 1.36.30 版本使用 Docker + Clerk 並且正常登入 > 更新到 1.41.0 or 1.42.0 版本在進行登出(此時就會進入卡住狀態)

URL "https://xxx/" 就會卡住,但手動補上 https://xxx/chat 就可以正常進入,但是只要刪除掉 /chat 就不會自動跳轉。

使用 Docker + Clerk 認證方式,沒有啟用 Pglite Client DB 功能,畫面停留在新版的啟動畫面[用戶狀態初始化...],不論刪除 cookie 或 Ctrl+F5 重新整理都相同狀況。

Chrome 瀏覽器的 DevTools Console 出現以下訊息:

警告:clerk.browser.js:12 Clerk: Clerk has been loaded with development keys. Development instances have strict usage limits and should not be used when deploying your application to production. Learn more: https://clerk.com/docs/deployments/overview

錯誤:5ea94cf1-d4d8dddaa4971af6.js:1 Uncaught Error: Minified React error #418; visit https://react.dev/errors/418?args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at rv (5ea94cf1-d4d8dddaa4971af6.js:1:30576)
at 5ea94cf1-d4d8dddaa4971af6.js:1:117133
at uf (5ea94cf1-d4d8dddaa4971af6.js:1:119861)
at uu (5ea94cf1-d4d8dddaa4971af6.js:1:112257)
at 5ea94cf1-d4d8dddaa4971af6.js:1:108295
at 5ea94cf1-d4d8dddaa4971af6.js:1:108302
at i8 (5ea94cf1-d4d8dddaa4971af6.js:1:108399)
at uD (5ea94cf1-d4d8dddaa4971af6.js:1:129037)
at MessagePort.T (19080-0089b75bb1cb1421.js:1:128713)

警告: Chrome is moving towards a new experience that allows users to choose to browse without third-party cookies.ultimate-bird-48.clerk.accounts.dev/v1/client?__clerk_api_version=2024-10-01&_clerk_js_version=5.43.2&__clerk_db_jwt=dvb_2qt5Tu3iHfOfvtutUQdid2ajDN5:1

@arvinxx
Copy link
Contributor

arvinxx commented Dec 29, 2024

是使用client db + auth 的方式?

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Is it using client db + auth?

@Sen-CaPoo
Copy link
Author

是使用client db + auth 的方式?

是的。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Is it using client db + auth?

Yes.

@arvinxx
Copy link
Contributor

arvinxx commented Dec 30, 2024

@Sen-CaPoo 建议切换到 server db + auth 哈。 Client db + auth 的方式目前已经不准备维护了,现在我们部署模式类型分支有点多,我们暂时没有精力能确保所有类型都能稳定。未来的部署方式 (LobeChat 2.0) 就只会收敛到两种:

  1. 基于 Pglite 的浏览器版本,不需要 auth,配置了auth 但不配 db 会强抛错。
  2. 基于 postgres 的服务端版本,需要完整auth、s3 和 db。

之前这个方案能用算是 bug as feature ,那个 bug 修掉以后这个不 work 了其实算是正常的。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@Sen-CaPoo suggested switching to server db + auth. The Client db + auth method is no longer planned to be maintained. Now we have too many branches of deployment mode types, and we currently do not have the energy to ensure that all types are stable. The future deployment method (LobeChat 2.0) will only converge to two types:

  1. The browser version based on Pglite does not require auth. If auth is configured but not configured with db, an error will be thrown.
  2. The server version based on postgres requires complete auth, s3 and db.

The fact that this solution worked before was actually a bug as feature. After the bug is fixed, it is actually normal for this solution not to work anymore.

@Sen-CaPoo
Copy link
Author

@Sen-CaPoo 建议切换到 server db + auth 哈。 Client db + auth 的方式目前已经不准备维护了,现在我们部署模式类型分支有点多,我们暂时没有精力能确保所有类型都能稳定。未来的部署方式 (LobeChat 2.0) 就只会收敛到两种:

  1. 基于 Pglite 的浏览器版本,不需要 auth,配置了auth 但不配 db 会强抛错。
  2. 基于 postgres 的服务端版本,需要完整auth、s3 和 db。

之前这个方案能用算是 bug as feature ,那个 bug 修掉以后这个不 work 了其实算是正常的。

理解,目前先採用應急手段就是手動將網址導向 /chat 順利使用,主要原因為我這邊是教學單位,同學們沒辦法保證都能備份好數據進行遷移 Pglite。

另外就是 postgres 在部屬上有些困難,還無法順利進行。

還是感謝 @arvinxx 與其他開發者的努力與貢獻,這個項目非常的棒。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@Sen-CaPoo suggests switching to server db + auth. The Client db + auth method is no longer planned to be maintained. Now we have too many branches of deployment mode types, and we currently do not have the energy to ensure that all types are stable. The future deployment method (LobeChat 2.0) will only converge to two types:

  1. The browser version based on Pglite does not require auth. If auth is configured but not configured with db, an error will be thrown.
  2. Server version based on postgres, requires complete auth, s3 and db.

When this solution worked before, it was regarded as a bug as a feature. After the bug is fixed, it is actually normal that this solution does not work.

Understand, the first emergency measure is to manually redirect the URL to /chat for smooth use. The main reason is that I am a teaching institution and there is no way for students to ensure that they can back up their data and migrate it to Pglite.

In addition, postgres has some difficulties in deployment and cannot proceed smoothly.

Thanks again to @arvinxx and other developers for their efforts and contributions. This project is great.

@arvinxx
Copy link
Contributor

arvinxx commented Dec 30, 2024

理解,目前先採用應急手段就是手動將網址導向 /chat 順利使用,主要原因為我這邊是教學單位,同學們沒辦法保證都能備份好數據進行遷移 Pglite。

嗯嗯了解,我们升级 2.0 大版本的时候会做好这个数据的自动迁移,届时直接切换 pglite 应该不会有太大的问题。

另外就是建议提前测试下 pglite 的方案下在你们的应用场景下是否会存在预期外的问题。这样可以尽早和我们反馈,看看有没有解法。

另外就是 postgres 在部屬上有些困難,還無法順利進行。

这块具体的问题是什么?是文档哪方面写的不够详细吗

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Understood, the first emergency measure is to manually redirect the URL to /chat for smooth use. The main reason is that I am a teaching institution and there is no way for students to guarantee that they can back up their data for migration to Pglite.

Yes, I understand. When we upgrade to the 2.0 major version, we will automatically migrate this data. At that time, there should be no big problem in directly switching to pglite.

In addition, it is recommended to test the pglite solution in advance to see if there are any unexpected problems in your application scenarios. This way you can give us feedback as early as possible to see if there is a solution.

In addition, postgres has some difficulties in deployment and cannot proceed smoothly.

What is the specific problem here? Is it because the document is not detailed enough?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working | 缺陷
Projects
Status: Roadmap - Chat 1.x
Development

No branches or pull requests

3 participants