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

Open Beginner friendly
#67,591 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript
Domain
frontend

Research direction

Read apps/dashboard/src/DashboardApp.vue, especially rerenderPanels() around lines 415–430, where the issue identifies the failing access and unreachable error log. Check how the function handles a missing panel and how its widgets are iterated. The change is done when an unknown panel is logged and skipped while later widgets still mount.

Written by the indexing model from the issue text.

Description

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

Dominant language
PHP
Stars
37.7k
Forks
5.4k
Avg merge
1d 23h
Merged PRs (30d)
585

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nextcloud/server

All issues in nextcloud/server

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.