-
Notifications
You must be signed in to change notification settings - Fork 11
Steve/v3-sse #4686
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
Steve/v3-sse #4686
Conversation
Walkthrough本次变更主要聚焦于改进 SSE(服务器发送事件)连接建立阶段的错误处理逻辑,并对相关测试用例进行了补充。此外,还简化了代理服务中处理安全 Cookie 标志的策略。具体包括:在 SSE 连接建立失败时,优先尝试从响应体中提取更详细的错误信息(支持 JSON 和纯文本),并在测试中覆盖了这些场景;同时,移除了代理服务中一项关于 HTTPS/HTTP 环境下安全 Cookie 标志调整的旧有条件。 Changes
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
packages/brick-container/serve/getProxy.jsOops! Something went wrong! :( ESLint: 9.22.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@next-core/eslint-config-next' imported from /eslint.config.mjs packages/utils/src/general/createSSEStream.spec.tsOops! Something went wrong! :( ESLint: 9.22.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@next-core/eslint-config-next' imported from /eslint.config.mjs packages/utils/src/general/createSSEStream.tsOops! Something went wrong! :( ESLint: 9.22.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@next-core/eslint-config-next' imported from /eslint.config.mjs 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧰 Additional context used🧬 Code Graph Analysis (2)packages/brick-container/serve/getProxy.js (1)
packages/utils/src/general/createSSEStream.spec.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (4)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request enhances error handling in the SSE stream creation logic and updates secure cookie handling in the proxy configuration. Key changes include:
- Updating the onopen handler in the SSE stream to parse error responses and re-throw a more specific error.
- Adding new tests to verify error handling for both JSON and non-JSON error responses in createSSEStream.
- Modifying the secure cookie strategy logic in getProxy.js to simplify the conditional branches.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/utils/src/general/createSSEStream.ts | Enhances error handling in the onopen event by parsing the response text and extracting JSON error information where possible. |
| packages/utils/src/general/createSSEStream.spec.ts | Adds tests for error scenarios in createSSEStream, specifically covering both JSON error responses and non-JSON error responses. |
| packages/brick-container/serve/getProxy.js | Updates the secure cookie strategy logic; the comments and branching have been modified to remove the https→http "clear" scenario. |
Comments suppressed due to low confidence (1)
packages/brick-container/serve/getProxy.js:119
- The comment still references a branch for clearing secure cookie flags that has been removed in the updated code. Please update the comment to reflect the new logic.
// - If the server is https, but the local is http, clear the secure cookie flags;
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v3 #4686 +/- ##
==========================================
- Coverage 95.26% 95.25% -0.01%
==========================================
Files 209 209
Lines 9037 9044 +7
Branches 1737 1738 +1
==========================================
+ Hits 8609 8615 +6
Misses 319 319
- Partials 109 110 +1
🚀 New features to boost your workflow:
|
next-core
|
||||||||||||||||||||||||||||
| Project |
next-core
|
| Branch Review |
steve/v3-sse
|
| Run status |
|
| Run duration | 00m 26s |
| Commit |
|
| Committer | Shenwei Wang |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
16
|
| View all changes introduced in this branch ↗︎ | |
依赖检查
组件之间的依赖声明,是微服务组件架构下的重要信息,请确保其正确性。
请勾选以下两组选项其中之一:
或者:
提交信息检查
Git 提交信息将决定包的版本发布及自动生成的 CHANGELOG,请检查工作内容与提交信息是否相符,并在以下每组选项中都依次确认。
破坏性变更:
feat作为提交类型。BREAKING CHANGE: 你的变更说明。新特性:
feat作为提交类型。问题修复:
fix作为提交类型。杂项工作:
即所有对下游使用者无任何影响、且没有必要显示在 CHANGELOG 中的改动,例如修改注释、测试用例、开发文档等:
chore,docs,test等作为提交类型。Summary by CodeRabbit
功能改进
测试