Skip to content

fix: file upload signed URL not falling back to default expiry when value is below threshold#40456

Merged
dionisio-bot[bot] merged 6 commits into
developfrom
fix/s3-gcs-url-expiry-timespan-passthrough
May 19, 2026
Merged

fix: file upload signed URL not falling back to default expiry when value is below threshold#40456
dionisio-bot[bot] merged 6 commits into
developfrom
fix/s3-gcs-url-expiry-timespan-passthrough

Conversation

@abhinavkrin
Copy link
Copy Markdown
Member

@abhinavkrin abhinavkrin commented May 8, 2026

Proposed changes (including videos or screenshots)

When FileUpload_S3_URLExpiryTimeSpan is set to 0 (or any value below 5), the raw value was passed directly to the signed URL generation, resulting in immediately-expired URLs and 403 errors on file previews (especially on MinIO).

This PR:

  • Adds a minimum threshold of 5 seconds for the expiry setting. Values below this are treated as "disabled" and fall back to a 15-minute default for both providers.
  • Creates a dedicated FileUpload_GoogleStorage_URLExpiryTimeSpan setting for Google Cloud Storage, which was previously (incorrectly) reusing the AWS S3 expiry setting — a setting that wasn't even visible when GCS was the active storage type.
  • Explicitly pins GCS signed URLs to version v2 and passes a fallback expiry when the setting is disabled (since expires is a required parameter for GCS).

Issue(s)

Steps to test or reproduce

  1. Set storage type to Amazon S3
  2. Set FileUpload_S3_URLExpiryTimeSpan to 0
  3. Upload a file and attempt to preview it
  4. Before fix: 403 error / expired URL
  5. After fix: File loads with a 15-minute signed URL

For Google Cloud Storage:

  1. Set storage type to Google Cloud Storage
  2. Observe the new "URLs Expiration Timespan" setting under GCS settings
  3. Set it to 0 — file previews still work (15-minute fallback)
  4. Set it to 120 — URLs expire after 2 minutes as expected

Further comments

SUP-1026

Summary by CodeRabbit

  • Bug Fixes

    • Fixed signed preview URLs expiring prematurely when very short expiry values were configured for S3 and Google Cloud Storage.
  • New Features

    • Added a dedicated URL expiry setting for Google Cloud Storage.
    • Enforced minimum expiry thresholds with automatic fallback to prevent invalid preview URLs.
  • Documentation

    • Updated UI text describing URL expiry behavior and minimum/fallback rules.
  • Tests

    • Added unit tests for expiry validation and fallback behavior.

Review Change Stack

Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
@abhinavkrin abhinavkrin requested a review from a team as a code owner May 8, 2026 13:12
@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented May 8, 2026

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 8, 2026

🦋 Changeset detected

Latest commit: bf0d591

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 43 packages
Name Type
@rocket.chat/i18n Patch
@rocket.chat/meteor Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-voip Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/gazzodown Patch
@rocket.chat/livechat Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/queue-worker Patch
@rocket.chat/ui-composer Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/http-router Patch
@rocket.chat/model-typings Patch
@rocket.chat/models Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/presence-service Patch
@rocket.chat/abac Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/license Patch
@rocket.chat/media-calls Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch
@rocket.chat/server-fetch Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@abhinavkrin abhinavkrin added this to the 8.5.0 milestone May 8, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0d3b29de-db99-4bb6-9731-9280eff7aeba

📥 Commits

Reviewing files that changed from the base of the PR and between cc987f1 and bf0d591.

📒 Files selected for processing (4)
  • apps/meteor/app/file-upload/server/lib/urlExpiry.spec.ts
  • apps/meteor/app/file-upload/server/lib/urlExpiry.ts
  • apps/meteor/app/file-upload/ufs/AmazonS3/server.ts
  • apps/meteor/app/file-upload/ufs/GoogleStorage/server.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/app/file-upload/ufs/GoogleStorage/server.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/file-upload/server/lib/urlExpiry.spec.ts
  • apps/meteor/app/file-upload/ufs/AmazonS3/server.ts
  • apps/meteor/app/file-upload/server/lib/urlExpiry.ts
**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • apps/meteor/app/file-upload/server/lib/urlExpiry.spec.ts
🧠 Learnings (5)
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.

Applied to files:

  • apps/meteor/app/file-upload/server/lib/urlExpiry.spec.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/app/file-upload/server/lib/urlExpiry.spec.ts
  • apps/meteor/app/file-upload/ufs/AmazonS3/server.ts
  • apps/meteor/app/file-upload/server/lib/urlExpiry.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/app/file-upload/server/lib/urlExpiry.spec.ts
  • apps/meteor/app/file-upload/ufs/AmazonS3/server.ts
  • apps/meteor/app/file-upload/server/lib/urlExpiry.ts
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.

Applied to files:

  • apps/meteor/app/file-upload/server/lib/urlExpiry.spec.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/app/file-upload/server/lib/urlExpiry.spec.ts
  • apps/meteor/app/file-upload/ufs/AmazonS3/server.ts
  • apps/meteor/app/file-upload/server/lib/urlExpiry.ts
🔇 Additional comments (3)
apps/meteor/app/file-upload/server/lib/urlExpiry.ts (1)

1-6: LGTM!

apps/meteor/app/file-upload/server/lib/urlExpiry.spec.ts (1)

1-16: LGTM!

apps/meteor/app/file-upload/ufs/AmazonS3/server.ts (1)

22-22: LGTM!

Also applies to: 85-85, 93-93, 207-207


Walkthrough

Enforce a 5-second minimum for signed URL expirations (900s fallback), add shared helper getUrlExpiryTimeSpanWithFallback and tests, introduce FileUpload_GoogleStorage_URLExpiryTimeSpan, and update S3 and GCS signed-URL logic, i18n, and changeset.

Changes

Signed URL Expiry Enforcement

Layer / File(s) Summary
i18n & changeset
.changeset/orange-bottles-glow.md, packages/i18n/src/locales/en.i18n.json
Patch changeset and English translations for the new GCS URL expiry setting and updated S3 description about ignoring values below 5s.
Settings Definition
apps/meteor/server/settings/file-upload.ts
New FileUpload_GoogleStorage_URLExpiryTimeSpan setting (int, default 120), enabled only for GoogleCloudStorage.
URL expiry helpers & tests
apps/meteor/app/file-upload/server/lib/urlExpiry.ts, apps/meteor/app/file-upload/server/lib/urlExpiry.spec.ts
Add MIN_URL_EXPIRY_TIME_SPAN_SECONDS = 5, URL_EXPIRY_FALLBACK_SECONDS = 900, and getUrlExpiryTimeSpanWithFallback(configuredValue); unit tests validate fallback (<5s) and passthrough (>=5s).
S3 signed-URL integration
apps/meteor/app/file-upload/ufs/AmazonS3/server.ts
Import expiry helper; getRedirectURL and getUrlExpiryTimeSpan() use getUrlExpiryTimeSpanWithFallback(...) to compute signed-URL expiry.
GCS signed-URL integration & wiring
apps/meteor/app/file-upload/ufs/GoogleStorage/server.ts, apps/meteor/app/file-upload/server/config/GoogleStorage.ts
Import expiry helper; getRedirectURL uses getUrlExpiryTimeSpanWithFallback(options.URLExpiryTimeSpan) for expires; getUrlExpiryTimeSpan() returns the helper-derived value; GoogleStorage.configure reads FileUpload_GoogleStorage_URLExpiryTimeSpan into store config.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main bug fix: file upload signed URLs now properly fall back to default expiry when configured values are below the minimum threshold.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • SUP-1026: Request failed with status code 401

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 6 files

Copy link
Copy Markdown
Contributor

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/meteor/app/file-upload/ufs/AmazonS3/server.ts`:
- Line 25: The inline trailing comment on the constant
S3_FALLBACK_EXPIRY_SECONDS should be removed to comply with coding guidelines;
edit the declaration of S3_FALLBACK_EXPIRY_SECONDS to eliminate the "// 15
minutes" comment and, if needed for clarity, expand the constant name (e.g.,
S3_FALLBACK_EXPIRY_SECONDS_15_MIN) or add a nearby module-level documentation
block (not an inline comment) to explain the value.

In `@apps/meteor/app/file-upload/ufs/GoogleStorage/server.ts`:
- Line 14: Remove the inline comment from the constant declaration for
GCS_FALLBACK_EXPIRY_SECONDS in server.ts; locate the constant named
GCS_FALLBACK_EXPIRY_SECONDS and delete the trailing "// 15 minutes" comment so
the line only declares the constant without any inline comment.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 683dde9a-613d-4186-a0c8-d3f80dc1efb0

📥 Commits

Reviewing files that changed from the base of the PR and between 2a927fa and 92145b5.

📒 Files selected for processing (6)
  • .changeset/orange-bottles-glow.md
  • apps/meteor/app/file-upload/server/config/GoogleStorage.ts
  • apps/meteor/app/file-upload/ufs/AmazonS3/server.ts
  • apps/meteor/app/file-upload/ufs/GoogleStorage/server.ts
  • apps/meteor/server/settings/file-upload.ts
  • packages/i18n/src/locales/en.i18n.json
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/file-upload/server/config/GoogleStorage.ts
  • apps/meteor/server/settings/file-upload.ts
  • apps/meteor/app/file-upload/ufs/AmazonS3/server.ts
  • apps/meteor/app/file-upload/ufs/GoogleStorage/server.ts
🧠 Learnings (4)
📚 Learning: 2026-03-16T21:50:37.589Z
Learnt from: amitb0ra
Repo: RocketChat/Rocket.Chat PR: 39676
File: .changeset/migrate-users-register-openapi.md:3-3
Timestamp: 2026-03-16T21:50:37.589Z
Learning: For changes related to OpenAPI migrations in Rocket.Chat/OpenAPI, when removing endpoint types and validators from rocket.chat/rest-typings (e.g., UserRegisterParamsPOST, /v1/users.register) document this as a minor changeset (not breaking) per RocketChat/Rocket.Chat-Open-API#150 Rule 7. Note that the endpoint type is re-exposed via a module augmentation .d.ts in the consuming package (e.g., packages/web-ui-registration/src/users-register.d.ts). In reviews, ensure the changeset clearly states: this is a non-breaking change, the major version should not be bumped, and the changeset reflects a minor version bump. Do not treat this as a breaking change during OpenAPI migrations.

Applied to files:

  • .changeset/orange-bottles-glow.md
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/app/file-upload/server/config/GoogleStorage.ts
  • apps/meteor/server/settings/file-upload.ts
  • apps/meteor/app/file-upload/ufs/AmazonS3/server.ts
  • apps/meteor/app/file-upload/ufs/GoogleStorage/server.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/app/file-upload/server/config/GoogleStorage.ts
  • apps/meteor/server/settings/file-upload.ts
  • apps/meteor/app/file-upload/ufs/AmazonS3/server.ts
  • apps/meteor/app/file-upload/ufs/GoogleStorage/server.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • apps/meteor/app/file-upload/server/config/GoogleStorage.ts
  • apps/meteor/server/settings/file-upload.ts
  • apps/meteor/app/file-upload/ufs/AmazonS3/server.ts
  • apps/meteor/app/file-upload/ufs/GoogleStorage/server.ts
🔇 Additional comments (7)
.changeset/orange-bottles-glow.md (1)

1-7: Changeset looks accurate and appropriately scoped.

The patch bumps and description match the PR’s bug-fix behavior (expiry fallback + dedicated GCS setting) without overstating impact.

packages/i18n/src/locales/en.i18n.json (1)

2320-2321: Localization updates align with the signed URL expiry fallback behavior.

The new GCS keys and updated S3 description clearly communicate the < 5 seconds => default 15 minutes behavior and match the PR intent.

Also applies to: 2365-2365

apps/meteor/server/settings/file-upload.ts (1)

255-262: LGTM — the new GCS expiry setting is correctly wired.

Mirrors the S3 counterpart exactly (type: 'int', default 120, enableQuery to GoogleCloudStorage, i18nDescription), and falls within the watchByRegex(/^FileUpload_GoogleStorage_/) watch automatically.

apps/meteor/app/file-upload/ufs/GoogleStorage/server.ts (2)

63-70: version: 'v2' with Date.now() millisecond-based expires is correct here.

The responseDisposition field is known to cause SignatureDoesNotMatch errors with version: 'v4' (upstream issue googleapis/nodejs-storage#1073), so pinning to v2 is the right call. This matches a confirmed upstream bug where responseDisposition combined with version: 'v4' causes signature validation failures, and switching to v2 resolves it. The expires: Date.now() + expirySeconds * 1000 format (milliseconds since epoch) is also consistent with the official @google-cloud/storage v2 examples.


76-78: LGTM — getUrlExpiryTimeSpan is consistent with the S3 implementation.

Returns the configured value when ≥ MIN_URL_EXPIRY_TIME_SPAN_SECONDS, otherwise null, cleanly signalling "disabled" to callers without affecting getRedirectURL (which always uses the fallback).

apps/meteor/app/file-upload/server/config/GoogleStorage.ts (1)

71-71: LGTM — correct decoupling from the S3 setting key.

FileUpload_GoogleStorage_URLExpiryTimeSpan is covered by watchByRegex(/^FileUpload_GoogleStorage_/), so the configure callback will fire correctly when this setting changes.

apps/meteor/app/file-upload/ufs/AmazonS3/server.ts (1)

88-89: LGTM — floor logic and getUrlExpiryTimeSpan are correct.

expiresIn is passed in seconds to @aws-sdk/s3-request-presigner (which expects seconds), and getUrlExpiryTimeSpan consistently returns null for below-threshold values in both providers.

Also applies to: 97-97, 210-212

Comment thread apps/meteor/app/file-upload/ufs/AmazonS3/server.ts Outdated
Comment thread apps/meteor/app/file-upload/ufs/GoogleStorage/server.ts Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 69.62%. Comparing base (dbce434) to head (bf0d591).
⚠️ Report is 55 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #40456      +/-   ##
===========================================
+ Coverage    69.57%   69.62%   +0.04%     
===========================================
  Files         3317     3328      +11     
  Lines       121867   122695     +828     
  Branches     21801    21931     +130     
===========================================
+ Hits         84794    85421     +627     
- Misses       33740    33927     +187     
- Partials      3333     3347      +14     
Flag Coverage Δ
e2e 59.16% <ø> (+0.27%) ⬆️
e2e-api 46.24% <100.00%> (-0.06%) ⬇️
unit 70.33% <92.30%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread packages/i18n/src/locales/en.i18n.json Outdated
Comment thread packages/i18n/src/locales/en.i18n.json
Comment thread apps/meteor/app/file-upload/ufs/AmazonS3/server.ts Outdated
@nazabucciarelli
Copy link
Copy Markdown
Contributor

you could add unit tests too

Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
@abhinavkrin
Copy link
Copy Markdown
Member Author

abhinavkrin commented May 13, 2026

you could add unit tests too

In order to prevent heavy mocking, extracted the logic into separate function to implement unit tests.

Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
Comment thread apps/meteor/app/file-upload/ufs/GoogleStorage/server.ts Outdated
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
@abhinavkrin abhinavkrin added the stat: QA assured Means it has been tested and approved by a company insider label May 18, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label May 18, 2026
@dionisio-bot dionisio-bot Bot added this pull request to the merge queue May 18, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 18, 2026
@scuciatto scuciatto modified the milestone: 8.5.0 May 18, 2026
@dionisio-bot dionisio-bot Bot added stat: ready to merge PR tested and approved waiting for merge and removed stat: ready to merge PR tested and approved waiting for merge labels May 18, 2026
@scuciatto scuciatto removed the stat: QA assured Means it has been tested and approved by a company insider label May 18, 2026
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label May 18, 2026
@scuciatto scuciatto added stat: ready to merge PR tested and approved waiting for merge stat: QA assured Means it has been tested and approved by a company insider labels May 18, 2026
@dionisio-bot dionisio-bot Bot added this pull request to the merge queue May 18, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 18, 2026
@abhinavkrin abhinavkrin removed the stat: QA assured Means it has been tested and approved by a company insider label May 19, 2026
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label May 19, 2026
@abhinavkrin abhinavkrin added stat: ready to merge PR tested and approved waiting for merge stat: QA assured Means it has been tested and approved by a company insider labels May 19, 2026
@dionisio-bot dionisio-bot Bot added this pull request to the merge queue May 19, 2026
Merged via the queue into develop with commit ebc9bab May 19, 2026
47 checks passed
@dionisio-bot dionisio-bot Bot deleted the fix/s3-gcs-url-expiry-timespan-passthrough branch May 19, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants