Dashboard: registering a widget without backend panel breaks the remaining widgets

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

Maintainer thường phản hồi trong vòng 1 ngày

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
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript
Lĩnh vực
frontend

Hướng nghiên cứu

Đọc apps/dashboard/src/DashboardApp.vue, đặc biệt là rerenderPanels() quanh dòng 415–430, nơi issue chỉ ra thao tác truy cập bị lỗi và dòng ghi log lỗi không thể chạy tới. Kiểm tra cách hàm xử lý khi thiếu panel và cách hàm duyệt qua các widget. Thay đổi hoàn tất khi một panel không xác định được ghi log và bỏ qua, trong khi các widget phía sau vẫn được mount.

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

Mô tả

1. to develop bug feature: dashboard
Bug description

rerenderPanels() reads this.panels[app].id before checking whether the panel exists:

https://github.com/nextcloud/server/blob/3a68340a6c806a18cdd0d9667a3b9ec5f096b135/apps/dashboard/src/DashboardApp.vue#L415-L430

If an app calls OCA.Dashboard.register() for an id that has no backend panel (e.g. the widget's app is disabled for the user, or the ids don't match), this throws a TypeError, which aborts the loop – so all widgets after it in the iteration are not mounted either. The intended logger.error branch for unknown panels further down is unreachable.

Steps to reproduce

Found by code reading.

  1. Register a dashboard widget callback via OCA.Dashboard.register('unknown-id', …).
  2. Other widgets registered later are not rendered, and a TypeError is logged in the console.
Expected behavior

Unknown panels are skipped (with the existing error log) without affecting other widgets.

Nextcloud version

master

Ngôn ngữ chính
PHP
Star
37.7k
Fork
5.4k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
585

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 nextcloud/server

Tất cả issue của nextcloud/server

Issue tương tự

Thêm issue về PHP

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.