Skip to content

[stable34] fix(AppStore/Fetcher): catch GenericFileException when reading cache file in Fetcher#60593

Open
backportbot[bot] wants to merge 2 commits into
stable34from
backport/60286/stable34
Open

[stable34] fix(AppStore/Fetcher): catch GenericFileException when reading cache file in Fetcher#60593
backportbot[bot] wants to merge 2 commits into
stable34from
backport/60286/stable34

Conversation

@backportbot
Copy link
Copy Markdown

@backportbot backportbot Bot commented May 20, 2026

Backport of PR #60286

@backportbot backportbot Bot requested a review from a team as a code owner May 20, 2026 00:51
@backportbot backportbot Bot added this to the Nextcloud 34 milestone May 20, 2026
@backportbot backportbot Bot requested review from Altahrim, ArtificialOwl, CarlSchwan and salmart-dev and removed request for a team May 20, 2026 00:51
…Fetcher

When the appstore cache file exists but getContent() throws a
GenericFileException (I/O error or OS-level permission failure), explicitly
delete the file and recreate it before writing fresh data — mirroring the
NotFoundException recovery path. If deletion itself fails, return [] cleanly.

Previously, the unhandled exception caused the entire apps settings page to
crash. The new test covers both the recovery path and deletion failure.

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Attempt delete before logging the warning, so the warning only fires
  when we know recovery will succeed
- Log an error (not silently return) when delete itself fails
- Use catch (\Exception) without variable (PHP 8)
- Replace willReturnArgument(1) with explicit willReturn(true) in test
- Add blank lines between logical blocks in test for readability

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@miaulalala miaulalala force-pushed the backport/60286/stable34 branch from fb69882 to adcd78a Compare May 20, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants