Skip to content

Fixed the issue of WebSocket asynchronous initialization #11946

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

Merged

Conversation

Zuoqiu-Yingyi
Copy link
Contributor

问题原因 | Reasons of Problem

由于 melody.Melody 的初始化是异步进行的, 因此在广播 WebSocket 的消息通道初次建立时会话还未初始化完成, 进而导致 WebSocket 连接无法建立
Because melody.Melody is initialized asynchronously, the session is not initialized when the broadcast WebSocket message channel is first established, which results in the failure to establish a WebSocket connection.

修复方案 | Fix Scheme

阻塞广播 WebSocket 建立请求直到会话初始化完成
Block broadcast WebSocket establishment requests until session initialization is complete

已经过测试 | TESTED

Verified

This commit was signed with the committer’s verified signature.
Zuoqiu-Yingyi Yingyi / 颖逸
…ation was complete

修复 WebSocket 广播未初始化完成即使用的问题

Verified

This commit was signed with the committer’s verified signature.
Zuoqiu-Yingyi Yingyi / 颖逸
改进广播相关 API
@88250 88250 added this to the 3.1.1 milestone Jul 11, 2024
@88250 88250 merged commit 1c0a763 into siyuan-note:dev Jul 11, 2024
1 check passed
@88250
Copy link
Member

88250 commented Jul 11, 2024

Thank you for your contribution. SiYuan will be more wonderful with you!
感谢你的贡献,思源有你更精彩!

@Zuoqiu-Yingyi Zuoqiu-Yingyi deleted the fix/websocket-broadcast-initialize branch July 11, 2024 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants