Skip to content

fix: [stable-9.0][OCISDEV-1685] remove stale group shares in jsoncs3 - #833

Merged
2403905 merged 1 commit into
stable-9.0from
fix/OCISDEV-1685-stale-group-shares-stable-9.0
Nov 23, 2026
Merged

2403905 merged 1 commit into
stable-9.0from
fix/OCISDEV-1685-stale-group-shares-stable-9.0

Conversation

@2403905

@2403905 2403905 commented Nov 20, 2026 •

Copy link
Copy Markdown

Backport of #813 to stable-9.0.

Dependency

This PR needs the backport of #751 (OCISDEV-855), #831. 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 stable-9.0. It passes this context to purgeSpace and logs the returned errors.
  • The tests in receivedsharecache_test.go use the new fullDownloadStorage. stable-9.0 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-stable-9.0 to stable-9.0 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 stable-9.0. 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. stable-9.0 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-stable-9.0 branch from c2ca151 to 86e9be9 Compare November 20, 2026 15:56
2403905 added a commit to owncloud/ocis that referenced this pull request Nov 23, 2026
…e manager

Update reva to the branch of owncloud/reva#833, the backport of
owncloud/reva#813. It depends on owncloud/reva#831, 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
…e manager

Update reva to the branch of owncloud/reva#833, the backport of
owncloud/reva#813. The branch is on top of the merged owncloud/reva#831.

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 b4c4df4 into stable-9.0 Nov 23, 2026
14 checks passed
@2403905
2403905 deleted the fix/OCISDEV-1685-stale-group-shares-stable-9.0 branch November 23, 2026 18:20
2403905 added a commit to owncloud/ocis that referenced this pull request Nov 23, 2026
…e manager

Update reva to the commit b4c4df426. It includes owncloud/reva#833, 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
…e manager (#13545)

Update reva to the commit b4c4df426. It includes owncloud/reva#833, 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]>
2403905 added a commit that referenced this pull request Nov 24, 2026
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 stable-9.0. 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. stable-9.0 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]>

Backport of #833 to stable-8.2.
2403905 added a commit to owncloud/ocis that referenced this pull request Nov 25, 2026
…e manager

Update reva to the commit 1b56ab246 of owncloud/reva#844, the backport of
owncloud/reva#833 to stable-8.2.

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 #13545 to stable-8.2.

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 25, 2026
…e manager (#13561)

* fix: [stable-8.2][OCISDEV-1685] remove stale group shares in the share manager

Update reva to the commit 1b56ab246 of owncloud/reva#844, the backport of
owncloud/reva#833 to stable-8.2.

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 #13545 to stable-8.2.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Roman Perekhod <[email protected]>

* docs: [stable-8.2][OCISDEV-1685] fix the pull request number in the changelog

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Roman Perekhod <[email protected]>

---------

Signed-off-by: Roman Perekhod <[email protected]>
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
2403905 added a commit that referenced this pull request Nov 25, 2026
…844)

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 stable-9.0. 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. stable-9.0 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]>

Backport of #833 to stable-8.2.
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.

4 participants