Skip to content

fix: Allow sharing for shared drive recipient even if readonly#3750

Merged
zatteo merged 1 commit intorelease/1.92.0from
fix/read-only-sharing
Mar 19, 2026
Merged

fix: Allow sharing for shared drive recipient even if readonly#3750
zatteo merged 1 commit intorelease/1.92.0from
fix/read-only-sharing

Conversation

@zatteo
Copy link
Member

@zatteo zatteo commented Mar 19, 2026

Related to cozy/cozy-stack#4698

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Refined share action visibility logic for shared-drive recipients when handling single file operations.

@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

Walkthrough

The PR modifies the displayCondition logic in the share action handler for shared-drive recipients. When a single file from a shared-drive recipient is selected, the visibility condition now evaluates to the negation of shouldHideIfSharedDriveRecipient instead of explicitly returning false. The remaining visibility requirements (allLoaded, hasWriteAccess, file count, and encryption status) remain unchanged.

Possibly related PRs

Suggested reviewers

  • JF-Cozy
  • rezk2ll
  • lethemanh
  • doubleface
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: allowing sharing functionality for shared drive recipients even when they have read-only access.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/read-only-sharing
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Health Improved (1 files improve in Code Health)

Gates Passed
3 Quality Gates Passed

See analysis details in CodeScene

View Improvements
File Code Health Impact Categories Improved
share.jsx 9.69 → 10.00 Complex Conditional

Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@bundlemon
Copy link

bundlemon bot commented Mar 19, 2026

BundleMon

Unchanged files (21)
Status Path Size Limits
static/js/(chunkId).(hash).js
1.07MB -
public/static/js/(chunkId).(hash).js
1.01MB -
static/js/cozy.(hash).js
922.16KB -
public/static/js/cozy.(hash).js
787.38KB -
(hash).js
336.11KB -
public/(hash).js
336.11KB -
services/qualificationMigration.js
283.41KB -
services/dacc.js
263.14KB -
static/js/main.(hash).js
163.98KB -
public/static/js/public.(hash).js
138.18KB -
public/static/js/lib-react.(hash).js
43.88KB -
static/js/lib-react.(hash).js
43.88KB -
public/static/css/cozy.(hash).css
33.87KB -
static/css/cozy.(hash).css
33.87KB -
public/static/js/lib-router.(hash).js
21.86KB -
static/js/lib-router.(hash).js
21.86KB -
static/css/main.(hash).css
16.99KB -
public/static/css/public.(hash).css
6.72KB -
manifest.webapp
3.04KB -
index.html
704B -
assets/manifest.json
185B -

Total files change -4B 0%

Unchanged groups (3)
Status Path Size Limits
**/*.js
7.43MB -
**/*.{png,svg,ico}
2.19MB -
**/*.css
128.57KB -

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/modules/actions/share.jsx`:
- Around line 35-36: The early return when isFromSharedDriveRecipient(files[0])
is true bypasses the allLoaded and isEncryptedFileOrFolder checks; change the
branch so that for the single-file shared-drive recipient case you still require
allLoaded to be true and that isEncryptedFileOrFolder(files[0]) is false before
returning (but keep the intentional bypass of hasWriteAccess). Concretely,
replace the immediate return of !shouldHideIfSharedDriveRecipient with a
conditional that returns !shouldHideIfSharedDriveRecipient && allLoaded &&
!isEncryptedFileOrFolder(files[0]) (while leaving other logic and the
files?.length === 1 check intact).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e6967801-45db-44bd-8c36-b315e0394f69

📥 Commits

Reviewing files that changed from the base of the PR and between 4ff07ba and 81c98a2.

📒 Files selected for processing (1)
  • src/modules/actions/share.jsx

@zatteo zatteo changed the base branch from master to release/1.92.0 March 19, 2026 13:35
@zatteo zatteo merged commit ccae529 into release/1.92.0 Mar 19, 2026
6 checks passed
@zatteo zatteo deleted the fix/read-only-sharing branch March 19, 2026 13:36
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.

2 participants