这是一款基于 Python 的交互式数据应用 WASM 打包器:将复杂的数据流,尤其是可视化,打包到单个文件中,完全可在浏览器内运行,使用…#784
这是一款基于 Python 的交互式数据应用 WASM 打包器:将复杂的数据流,尤其是可视化,打包到单个文件中,完全可在浏览器内运行,使用…#784chenziqi66 wants to merge 1 commit intoStructuredLabs:mainfrom
Conversation
… Pyodide、DuckDB、Pandas 和 Plotly、Matplotlib 等。 我发现了如下的几个bug,请你帮我修正: 1. 函数返回类型不匹配 - 异常路径缺失返回值 2. 函数异常路径不返回值 3. 已知标记Bug 4. 拼写错误 5. 不一致的日志记录方式 6. 单例模式竞态条件 7. 过度宽泛的异常捕获 8. 生产环境遗留Debug日志 9. Logger级别不一致 10. 生产环境遗留大量console.log 约束: 1. 修复前必须先复现bug 2. 所有现有测试必须全部通过 3. 必须为该bug新增专门的测试用例 4.只修改与bug直接相关的代码
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 4 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ec6fe10. Configure here.
| // If we're already initialized, return the existing worker | ||
| if (workerInstance) { | ||
| console.log('[Service] Reusing existing worker instance'); | ||
| logger.debug('[Service] Reusing existing worker instance'); |
There was a problem hiding this comment.
Double namespace prefix in service.js log messages
Low Severity
The logger is created with createLogger('Service') and _formatMessage prepends [${this.namespace}] to every message. But the message strings still include the [Service] prefix (e.g., '[Service] Reusing existing worker instance'), resulting in doubled output like [Service] [Service] Reusing existing worker instance.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit ec6fe10. Configure here.
| async connect(config = {}) { | ||
| if (this.isConnecting || (this.socket && this.socket.readyState === WebSocket.OPEN)) { | ||
| console.log('[WebSocket] Already connected or connecting'); | ||
| logger.debug('[WebSocket] Already connected or connecting'); |
There was a problem hiding this comment.
Double [WebSocket] prefix in WebSocketClient log messages
Low Severity
The module-level logger uses namespace 'WebSocket' (createLogger('WebSocket')), and _formatMessage automatically prepends [WebSocket]. But dozens of WebSocketClient method log calls still include [WebSocket] in their message strings, producing doubled output like [WebSocket] [WebSocket] Connecting.... This affects all WebSocketClient class methods throughout the file.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit ec6fe10. Configure here.
| and stmt.value.func.value.id in self._current_frame.variable_to_atom | ||
| ): | ||
| logger.debug('[DEBUG] going to call _lift_side_effect_stmt for %s', stmt.value.func.value.id) | ||
| logger.debug(f'going to call _lift_side_effect_stmt for %s', stmt.value.func.value.id) |
There was a problem hiding this comment.
Mixed f-string and %-format in debug log call
Low Severity
logger.debug(f'going to call _lift_side_effect_stmt for %s', stmt.value.func.value.id) uses an f-string prefix with a %s placeholder and a separate argument. The f prefix is meaningless here (no {} expressions) and the %s relies on logging's lazy formatting, but every other converted log call in this file uses proper f-strings with {expr}. This is an incomplete conversion that's inconsistent and misleading.
Reviewed by Cursor Bugbot for commit ec6fe10. Configure here.
|
|
||
| const updateCount = Object.keys(stateUpdates).length; | ||
| console.log(`[App] Processing bulk state update: ${updateCount} components`); | ||
| logger.debug(`Processing bulk state update: ${updateCount} components`); |
There was a problem hiding this comment.
Remaining console.warn not migrated to logger in App
Low Severity
One console.warn('[App] Invalid component found during bulk state update:', component) call was not converted to logger.warn(...) while every other console.* call in App.jsx was migrated. This is inconsistent with the logging migration and will bypass the logger's level filtering in production.
Reviewed by Cursor Bugbot for commit ec6fe10. Configure here.


… Pyodide、DuckDB、Pandas 和 Plotly、Matplotlib 等。
我发现了如下的几个bug,请你帮我修正:
约束:
name: Pull Request
about: Create a pull request to contribute to the project
title: ''
labels: ''
assignees: ''
Related Issue
Fixes #(issue)
Description of Changes
A clear and concise description of the changes made in this pull request.
Type of Change
Testing
Please describe the tests that you ran to verify your changes. Include screenshots/videos.
Checklist
Note
Medium Risk
Touches core service initialization and data interface error-path return values; behavior changes could affect callers and concurrency, though changes are localized and covered by new tests.
Overview
Introduces a frontend
loggerutility (frontend/src/lib/logger.js) with environment-based log levels, and replaces widespreadconsole.log/console.warn/console.errorusage in the app, worker service, and the WebSocket/transport layer with namespacedlogger.*calls to reduce production noise while preserving diagnostics.Hardens backend error handling and consistency:
preswald.interfaces.datanow returnsNone/emptyDataFrameon exceptions,BasePreswaldService.initializeis made thread-safe via an_instance_lock, overly broad exception handling is narrowed, and remaining debug/print-style logs are normalized to proper logger levels.Adds targeted unit tests covering the new exception return behaviors, destructor cleanup robustness, and singleton/thread-safety guarantees.
Reviewed by Cursor Bugbot for commit ec6fe10. Bugbot is set up for automated code reviews on this repo. Configure here.