Skip to content

fix(content-sharing): grey link expiration from server flag - #4886

Draft
jpan-box wants to merge 1 commit into
box:masterfrom
jpan-box:fix-grey-shared-link-expiration
Draft

jpan-box wants to merge 1 commit into
box:masterfrom
jpan-box:fix-grey-shared-link-expiration

Conversation

@jpan-box

@jpan-box jpan-box commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

MOTIVATION

Desktop Content Sharing turned Link Expiration on when the user could change the shared link access level and an editor role was allowed. GET /2.0/files/{id}?fields=shared_link_features now returns expiration for that permission. The switch follows that value.

BEFORE

  • Link Expiration stays on when the user can change share access and an editor role is allowed
  • A files response with no expiration value uses that same check

AFTER

  • Link Expiration stays on when shared_link_features.expiration is true
  • A files response with no expiration value leaves the switch off

@jpan-box
jpan-box requested a review from a team as a code owner October 6, 2026 16:20
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 64be3159-9bf6-4714-91e7-b28c9c647b9c
📥 Commits

Reviewing files that changed from the base of the PR and between 430cf02 and 7d71272.

📒 Files selected for processing (4)
  • src/common/types/core.js
  • src/elements/content-sharing/types.js
  • src/elements/content-sharing/utils/__tests__/convertItemResponse.test.ts
  • src/elements/content-sharing/utils/convertItemResponse.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


Walkthrough

Shared-link types now include an optional expiration feature. Item conversion uses the server-provided value to set canChangeExpiration when present. Otherwise, it uses the existing fallback. Tests cover server values of false and true.

Changes

Shared-link expiration capability

Layer / File(s) Summary
Expiration capability and conversion
src/common/types/core.js, src/elements/content-sharing/types.js, src/elements/content-sharing/utils/convertItemResponse.ts, src/elements/content-sharing/utils/__tests__/convertItemResponse.test.ts
The shared-link types add an optional expiration boolean. Conversion uses that value for canChangeExpiration when it is not nullish; otherwise, it requires both canChangeAccessLevel and isEditAllowed. Tests cover explicit false and true values.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: reneshen0328

Merge Risk: ⚪ Minimal · up to 7d712

The expiration switch follows the server setting when provided and retains existing editor-based behavior when it is omitted. The covered paths leave no actionable merge risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 4…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the content-sharing link expiration change and its use of a server flag.
Description check ✅ Passed The description explains the motivation and the before-and-after behavior. It provides enough context to understand the change; the repository template contains merge guidance but no required descript…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks the link at night
And finds expiration set just right
A true or false comes through the wire
The fallback waits when values tire
Then hops away beneath the moon

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

@jpan-box
jpan-box marked this pull request as draft October 6, 2026 22:31
@jpan-box
jpan-box force-pushed the fix-grey-shared-link-expiration branch from 7d71272 to fa7f945 Compare October 6, 2026 22:32
Comment thread src/common/types/core.js

type SharedLinkFeatures = {
download_url: boolean,
expiration?: boolean,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

wouldn't expiration always exist now since we have added the field in the response

shared_link?: APISharedLink,
shared_link_features: {
download_url: boolean,
expiration?: boolean,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as above

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.

2 participants