Skip to content

fix: [OCISDEV-1685] remove stale group shares in jsoncs3 - #832

Merged
2403905 merged 1 commit into
mainfrom
fix/OCISDEV-1685-stale-group-shares-main
Nov 23, 2026
Merged

2403905 merged 1 commit into
mainfrom
fix/OCISDEV-1685-stale-group-shares-main

Conversation

@2403905

@2403905 2403905 commented Nov 20, 2026 •

Copy link
Copy Markdown

Backport of #813 to main.

Dependency

This PR needs the backport of #751 (OCISDEV-855), #830. That PR is merged.

Problem

The jsoncs3 share manager uploaded received.json again on each listing of the received shares when a user had a stale group share. A stale group share is a share ID in the group cache that has no share in the provider cache. The removal changed nothing, the stale ID stayed, and this repeated on each listing. Stale group shares come from partial write failures in Share and removeShare.

Ticket: OCISDEV-1685. The description and the numbers are in #813.

Change

Same as #813: the cleanup of stale group shares with a grace period, the rollback in Share, the batch removal with one upload per document, the drop of the cached document after a failed upload, the fix for the panic in sharecache.Cache.Remove (OCISDEV-1675), and the ShareExpired event once for each expired share.

Differences from #813

  • ProcessEvents in pkg/share/manager/jsoncs3/jsoncs3.go keeps the tracing and autoprop context of main. It passes this context to purgeSpace and logs the returned errors.
  • The tests in receivedsharecache_test.go use the new fullDownloadStorage. main has a newer metadata.Disk. It answers NotModified when IfNoneMatch has the etag of the file. Five tests inject a conflict while the file does not change. Then the re-read keeps the state of the failed write. A real conflict changes the etag, so the production code is not affected. Without the new test storage, these five tests fail.
  • The changelog entry links this PR and fix: [stable-8.0][OCISDEV-1685] remove stale group shares in jsoncs3 #813.

Tests

  • go test -race passes for ./pkg/share/manager/jsoncs3/....
  • go build ./... passes.

🤖 Generated with Claude Code

@kw-security

kw-security commented Nov 20, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Base automatically changed from fix/OCISDEV-1685-main to main November 20, 2026 15:52
Backport of #813 from stable-8.0 (cherry picked from commit ee73b99).

This commit depends on the backport of #751 (OCISDEV-855). It applies on top of it.

Differences from #813:

1. ProcessEvents keeps the tracing and autoprop context of main. It passes
   this context to purgeSpace and logs the errors that purgeSpace returns.
2. The tests of the received share cache use the new test storage
   fullDownloadStorage. main has a newer metadata.Disk. It answers NotModified
   when IfNoneMatch has the etag of the file. The tests inject a conflict
   while the file does not change, so a re-read would keep the state of the
   failed write. A real conflict changes the etag, and the production code is
   not affected.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@2403905
2403905 force-pushed the fix/OCISDEV-1685-stale-group-shares-main branch from ab7fd99 to 5872071 Compare November 20, 2026 15:55
2403905 added a commit to owncloud/ocis that referenced this pull request Nov 23, 2026
Update reva to the branch of owncloud/reva#832, the backport of
owncloud/reva#813. It depends on owncloud/reva#830, the backport of
owncloud/reva#751.

A stale group share is a share ID in the group cache that has no share. On
each listing of the received shares, the jsoncs3 share manager uploaded the
received.json file of the user again with the same content, and the stale ID
stayed. The new reva removes stale group shares, and it removes many shares
with one upload for each document.

The removal of shares uses at least 3 parallel removals, also when
SHARING_USER_JSONCS3_MAX_CONCURRENCY is 1. The default of the setting does
not change. The setting description and the changelog describe the minimum.

Backport of #13460.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Roman Perekhod <[email protected]>
2403905 added a commit to owncloud/ocis that referenced this pull request Nov 23, 2026
Update reva to the branch of owncloud/reva#832, the backport of
owncloud/reva#813. The branch is on top of the merged owncloud/reva#830.

A stale group share is a share ID in the group cache that has no share. On
each listing of the received shares, the jsoncs3 share manager uploaded the
received.json file of the user again with the same content, and the stale ID
stayed. The new reva removes stale group shares, and it removes many shares
with one upload for each document.

The removal of shares uses at least 3 parallel removals, also when
SHARING_USER_JSONCS3_MAX_CONCURRENCY is 1. The default of the setting does
not change. The setting description and the changelog describe the minimum.

Backport of #13460.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Roman Perekhod <[email protected]>
@2403905
2403905 marked this pull request as ready for review November 23, 2026 16:41
@2403905
2403905 requested a review from a team as a code owner November 23, 2026 16:41
@2403905
2403905 merged commit 33e2230 into main Nov 23, 2026
14 checks passed
@2403905
2403905 deleted the fix/OCISDEV-1685-stale-group-shares-main branch November 23, 2026 16:42
2403905 added a commit to owncloud/ocis that referenced this pull request Nov 23, 2026
Update reva to the commit 33e223087. It includes owncloud/reva#832, the
backport of owncloud/reva#813.

A stale group share is a share ID in the group cache that has no share. On
each listing of the received shares, the jsoncs3 share manager uploaded the
received.json file of the user again with the same content, and the stale ID
stayed. The new reva removes stale group shares, and it removes many shares
with one upload for each document.

The removal of shares uses at least 3 parallel removals, also when
SHARING_USER_JSONCS3_MAX_CONCURRENCY is 1. The default of the setting does
not change. The setting description and the changelog describe the minimum.

Backport of #13460.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Roman Perekhod <[email protected]>
2403905 added a commit to owncloud/ocis that referenced this pull request Nov 23, 2026
…13544)

Update reva to the commit 33e223087. It includes owncloud/reva#832, the
backport of owncloud/reva#813.

A stale group share is a share ID in the group cache that has no share. On
each listing of the received shares, the jsoncs3 share manager uploaded the
received.json file of the user again with the same content, and the stale ID
stayed. The new reva removes stale group shares, and it removes many shares
with one upload for each document.

The removal of shares uses at least 3 parallel removals, also when
SHARING_USER_JSONCS3_MAX_CONCURRENCY is 1. The default of the setting does
not change. The setting description and the changelog describe the minimum.

Backport of #13460.

Signed-off-by: Roman Perekhod <[email protected]>
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
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.

3 participants