[Bug]: v0.1.61 fails to initialize preload script due to system memory information error on Linux

Đang mở Phù hợp với người mới
#167 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
electron, javascript
Lĩnh vực
desktop

Hướng nghiên cứu

Báo cáo xác định out/preload/index.js và lệnh gọi process.getSystemMemoryInfo() là điểm có khả năng gây lỗi. Trước tiên, hãy tìm mã nguồn preload tạo ra lệnh gọi này và kiểm tra cách mã xử lý lỗi trong môi trường Linux được sandbox. Hoàn thành khi cầu nối preload khởi tạo được ngay cả khi không có thông tin bộ nhớ; hãy xác minh bằng cách chạy trên Linux hoặc bằng một bài kiểm thử tập trung nếu dự án có cung cấp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug
GUI version

0.1.61

Operating system

Linux (other)

Reproduction steps

Environment

Application: Command Code Desktop

GUI version: 0.1.61

Operating system: Manjaro Linux

Desktop environment: Hyprland

Display server: Wayland

GPU: NVIDIA GeForce RTX 5090

Installation type: AppImage

Upgrade path: Automatically upgraded from v0.1.60 using the in-app updater

Description

After Command Code automatically updated from v0.1.60 to v0.1.61, the application became unusable.

The main process starts normally, and the application window reaches the ready-to-show stage. However, the renderer displays the following generic error page:

"An unexpected error occurred. Reloading usually fixes this..."

Clicking Reload does not resolve the problem. The same error occurs repeatedly.

Expected behavior

The preload script should initialize successfully, and the application should remain usable even if system memory information cannot be retrieved.

Possible cause and suggested investigation

Could the development team investigate whether process.getSystemMemoryInfo() is failing in the sandboxed preload environment?

It may be worth adding error handling and a fallback value so that failure to retrieve system memory information does not prevent the entire preload script from initializing.

The --no-sandbox workaround mentioned in another report may be useful for diagnosis, but I have not independently verified it.

Impact

The application is completely unusable on my system after upgrading to v0.1.61.

Reloading does not recover the application.

Additional information

I have not modified system permissions, NVIDIA drivers, or Electron sandbox settings to work around this issue.

I can provide additional sanitized logs if needed.

Actual behavior

When launching the application with Chromium logging enabled:

AppImage/CommandCode-0.1.61-x86_64.AppImage --enable-logging=stderr --v=1

The following errors appear:

  1. Preload script initialization failure

Unable to load preload script:
.../resources/app/out/preload/index.js

Error: Unable to retrieve system memory information

  1. Renderer-side IPC bridge errors

TypeError: Cannot read properties of undefined (reading 'authStatus')

TypeError: Cannot read properties of undefined (reading 'onMenuAction')

Additional investigation

Inspection of the packaged preload script revealed the following code:

residentChatLimit: l(process.getSystemMemoryInfo().total * 1024),

The main window is configured with:

webPreferences: {
contextIsolation: true,
nodeIntegration: false,
sandbox: true
}

This suggests that the memory information call may be throwing an exception during preload initialization.

If this happens before contextBridge.exposeInMainWorld() executes, the electronAPI bridge will not be exposed to the renderer, which would explain the subsequent authStatus and onMenuAction errors.

I also found an independent report describing an almost identical failure on Linux with version 0.1.61, including the same system memory information error and subsequent IPC bridge errors.

This suggests the issue may not be specific to my system.

Screenshots, recordings, or sanitized logs

No response

Safety check
  • I removed credentials and private project information from this report.
Ngôn ngữ chính
Shell
Star
110
Fork
9
Merge trung bình
12 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của CommandCodeAI/desktop

Tất cả issue của CommandCodeAI/desktop

Issue tương tự

Thêm issue về Shell/Bash

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.