Skip to content

fix(files_trashbin): read the default trash bin size as an integer - #66048

Open
Phillipxh wants to merge 1 commit into
nextcloud:masterfrom
Phillipxh:fix/trashbin-size-read-as-int
Open

Phillipxh wants to merge 1 commit into
nextcloud:masterfrom
Phillipxh:fix/trashbin-size-read-as-int

Conversation

@Phillipxh

Copy link
Copy Markdown
  • Resolves: #

Summary

occ trashbin:size <size> stores the default trash bin size with IAppConfig::setValueInt(), but Trashbin::getConfiguredTrashbinSize() read it with getValueString(). AppConfig then throws AppConfigTypeConflictException:

Config value files_trashbin/trashbin_size is stored as integer but was requested as string

This happens on every write to a user's files (resizeTrash via the post-write listener) and on every trash bin expiry (Command\Expire), so the configured size never takes effect and the log fills up — on my instance ~900 errors in a week after running occ trashbin:size.

The fix reads the value with getValueInt(), which matches the writer in Command\Size (which already uses getValueInt() for display) and still accepts values stored without a type by older versions or occ config:app:set. I checked both cases on a 35.0.1 instance:

stored as getValueString() getValueInt()
int (occ trashbin:size) AppConfigTypeConflictException ✅ value
mixed (legacy / config:app:set) ✅ value ✅ value
not set '-1' ✅ -1

The per-user value is unchanged: Command\Size writes it as a string via setUserValue(), which matches the getValueString() reader.

TODO

  • Backport to stable35 (and earlier stable branches if affected)

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Tests are included
  • Screenshots before/after for front-end changes (not applicable)
  • Documentation has been updated or is not required
  • Backports requested where applicable
  • Labels added where applicable
  • Milestone added for target branch/version

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

🤖 Generated with Claude Code

https://claude.ai/code/session_019TNUHUT6jaQ3BHvjvdf4Ny

@Phillipxh
Phillipxh requested a review from a team as a code owner October 30, 2026 16:49
@Phillipxh
Phillipxh requested review from leftybournes, pabzm and salmart-dev and removed request for a team October 30, 2026 16:49
`occ trashbin:size <size>` stores the default size with setValueInt(),
but Trashbin::getConfiguredTrashbinSize() read it with getValueString().
AppConfig then throws AppConfigTypeConflictException ("stored as integer
but was requested as string") on every write to a user's files and on
every trash bin expiry, so the configured size never takes effect and
the log fills up with errors.

Read it with getValueInt(), which matches the writer and still accepts
values stored without a type by older versions or `occ config:app:set`.

Assisted-by: ClaudeCode:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019TNUHUT6jaQ3BHvjvdf4Ny
Signed-off-by: Phillipxh <150742483+Phillipxh@users.noreply.github.com>
@Phillipxh
Phillipxh force-pushed the fix/trashbin-size-read-as-int branch from 4cb747f to 413a77b Compare October 30, 2026 18:46

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant