``IBootstrap::register`` called for apps that are only enabled for a group of users
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Steps to reproduce
- Install and enable the Calendar app, but only for some users
- Open the dashboard as one of the excluded users
Expected behavior
There is no Calendar dashboard
Actual behavior
The Calendar dashboard is there and errors.
Server configuration
Nextcloud version: 22.2
Analysis
Dashboard widgets are just one example. Anything an app registers in that method is there even when it shouldn't.
As far as I could debug this happens because in \OC\AppFramework\Bootstrap\Coordinator::runInitialRegistration OC_App::getEnabledApps() return all apps, regardless of their user groups. That is because of at the time of calling the user context has not been set up yet. Only shortly later we start to load the database user back-end and similar. Afterwards OC_App::getEnabledApps() gives correct results, but not before.
Nevertheless I have not found a way to flip the order of this initialization, it just introduced even more severe problems.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the Calendar app enabled for only some users, then inspect OC\AppFramework\Bootstrap\Coordinator::runInitialRegistration and OC_App::getEnabledApps(). Trace how app registration occurs before the user context is initialized; done means excluded users no longer see or encounter Calendar dashboard widgets or other registrations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100