Skip to content

[stable34] fix(user_status): stabilise the user_status#61617

Open
backportbot[bot] wants to merge 4 commits into
stable34from
backport/59535/stable34
Open

[stable34] fix(user_status): stabilise the user_status#61617
backportbot[bot] wants to merge 4 commits into
stable34from
backport/59535/stable34

Conversation

@backportbot

@backportbot backportbot Bot commented Jun 26, 2026

Copy link
Copy Markdown

Backport of PR #59535

…m list methods

The background cleanup job operated on all rows including backups:
- clearOlderThanClearAt() deleted backup rows with expired clear_at,
  destroying saved statuses before they could be restored
- clearStatusesOlderThan() overwrote backup statuses to OFFLINE,
  corrupting saved DND/away states

Additionally, findAll() leaked backup rows into user-facing lists,
and findAllRecent() filtered backups via slow LIKE pattern instead
of the is_backup column.

Add is_backup=false filter to all four methods.

AI-Assisted-By: Claude Opus 4.6
Signed-off-by: Anna Larch <anna@nextcloud.com>
UserDeletedListener only called removeUserStatus(), leaving backup
status rows (prefixed _userId) orphaned in the database forever.

AI-Assisted-By: Claude Opus 4.6
Signed-off-by: Anna Larch <anna@nextcloud.com>
Multiple code paths in StatusService silently swallowed failures,
making it impossible to debug status reliability issues. Add debug
logging for: backup creation conflicts, aborted automated status
changes, failed revert operations, and concurrent insert conflicts.

AI-Assisted-By: Claude Opus 4.6
Signed-off-by: Anna Larch <anna@nextcloud.com>
… queries

- testFindAllExcludesBackups: verify findAll() doesn't return backup rows
- testFindAllRecentExcludesBackups: verify findAllRecent() excludes backups
- testClearOlderThanClearAtPreservesBackups: verify backup rows survive
  clear_at cleanup
- testClearStatusesOlderThanPreservesBackups: verify backup statuses aren't
  overwritten to OFFLINE by age-based cleanup
- testHandleWithCorrectEvent: verify removeBackupUserStatus() is also called
  when a user is deleted

AI-Assisted-By: Claude Opus 4.6
Signed-off-by: Anna Larch <anna@nextcloud.com>
@backportbot backportbot Bot requested a review from a team as a code owner June 26, 2026 21:17
@backportbot backportbot Bot requested review from ArtificialOwl, CarlSchwan, leftybournes, miaulalala, nickvergessen, provokateurin and salmart-dev and removed request for a team June 26, 2026 21:17
@backportbot backportbot Bot added this to the Nextcloud 34.0.2 milestone Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant