nextcloud / nextcloud/integration_paperless
TypeError in ConfigService when LoadAdditionalScriptsEvent fires on pages without a logged-in user (e.g. Nextcloud Talk recording page) – breaks recording feature entirely
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 38
- Forks
- 8
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 3
Description
Bug description
integration_paperless registers a listener for OCP\Collaboration\Resources\LoadAdditionalScriptsEvent, which fires on any page rendering that event – including anonymous/guest pages where no user is logged in. In that case $userId is null, but ConfigService::__construct() requires a string, causing an uncaught TypeError that breaks the entire page request.
This became especially critical because it silently breaks the Nextcloud Talk call recording feature: the recording page (/call/{token}/recording) is rendered as a PublicTemplateResponse for an anonymous participant, without any indication in the browser/network response other than a failed JS execution (OCA.Talk is undefined), making this extremely hard to diagnose. It caused several unresolved reports in the Talk/AIO community for this exact symptom (see e.g. nextcloud/all-in-one#3276 and help.nextcloud.com/t/talk-recording-not-working/223577), where the actual root cause was this exception, not Talk/AIO/network/reverse proxy configuration.
Steps to reproduce
- Install
integration_paperless(v1.0.13) alongside Nextcloud Talk with recording enabled - Start a call and start a recording
- The recording fails with "contact your administrator"
Expected behavior
The recording page loads normally and OCA.Talk is initialized correctly.
Actual behavior
Uncaught TypeError in nextcloud.log:
OCA\Paperless\Service\ConfigService::__construct(): Argument #2 ($userId) must be of type string, null given
in file '/var/www/html/custom_apps/integration_paperless/lib/Service/ConfigService.php' line 14
Triggered via:
PageController.php(351): OC\EventDispatcher\EventDispatcher->dispatchTyped(LoadAdditionalScriptsEvent)
→ ServiceEventListener->__invoke(...)
→ OCA\Paperless\Listener\FileActionListener
→ OCA\Paperless\Service\ConfigService::__construct($userConfig, null)
This causes the entire request (/index.php/call/{token}/recording) to fail server-side, which in turn breaks the JS on the page (no OCA.Talk object), which breaks the Selenium-based recording bot in nextcloud-aio-talk-recording.
Environment
- Nextcloud Server: 33.0.6.2
- Nextcloud Talk (spreed): 23.0.9
- integration_paperless: 1.0.13
- Deployment: Nextcloud AIO on Unraid, Cloudflare Tunnel reverse proxy (confirmed not proxy/network related — issue reproduces identically via direct internal connection)
Suggested fix
FileActionListener/ConfigService should handle a null $userId gracefully (e.g. skip registering the file action, or make the constructor parameter nullable) instead of throwing on any anonymous/guest page load.
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
Start with lib/Listener/FileActionListener and lib/Service/ConfigService, then reproduce the LoadAdditionalScriptsEvent on an anonymous or guest page. Trace how the null user ID reaches ConfigService::__construct(). Done means anonymous page requests no longer throw a TypeError and the Talk recording page loads with OCA.Talk initialized.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100