Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Hourly capabilities/discovery refresh rewrites appdata files even when unchanged (wakes sleeping disks)

Open Beginner friendly
#6,250 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
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php
Domain
backend

Research direction

Start with lib/Service/CachedRequestService.php, especially the fetch() method at the line cited in the issue, and inspect how it reads and writes cached response files. Check the existing tests for CachedRequestService and add coverage for identical and changed responses. Done means unchanged content no longer triggers a file write while the distributed cache still refreshes hourly.

Written by the indexing model from the issue text.

Description

Describe the bug

ObtainCapabilities runs every hour and calls fetch() on CapabilitiesService and DiscoveryService. CachedRequestService::fetch() always rewrites appdata_*/richdocuments/remoteData/capabilities and discovery, even when the response is identical to the stored file. In practice the content almost never changes.

On a server where the data directory lives on hard disks that spin down when idle, this hourly write wakes the disks every time. I traced it with fatrace for one night: the disks were woken within a minute of each of these writes (roughly every 65 minutes), and nothing else touched the pool between scheduled backups.

Expected behavior

Only write the file when the content differs from what is already stored (for example: compare with getContent() of the existing file, or keep a hash in the distributed cache, and skip newFile() when unchanged). The distributed cache can still be refreshed every hour.

Setup
  • richdocuments 11.1.2 (same code on main, lib/Service/CachedRequestService.php line 86)
  • Nextcloud AIO with the built-in Collabora container
  • Data directory on a ZFS pool of HDDs with a spindown timer

Workaround for now: put appdata_*/richdocuments/remoteData on an SSD with a separate mount.

Dominant language
JavaScript
Stars
459
Forks
150
Avg merge
1d 3h
Merged PRs (30d)
103

Getting set up

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/richdocuments

All issues in nextcloud/richdocuments

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.