-
-
Notifications
You must be signed in to change notification settings - Fork 11
fix(pushduck): use routeConfig.expiresIn for presigned download URL expiry #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
3nvy
wants to merge
1
commit into
abhay-ramesh:main
Choose a base branch
from
3nvy:fix/download-presigned-url-default-expiresin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't reuse the upload TTL as the download TTL implicitly.
routeConfig.expiresInis currently documented in this file as the presigned upload URL expiry (S3Route.expiresInandS3RouteConfig.expiresIn), but this change also applies it to the completion-time download URL. That makes short upload windows also shorten returned download links, which is a visible contract change for existing routes. Please either introduce a separate download-expiry setting or update the route API/docs explicitly so this isn't an undocumented behavior change.π€ Prompt for AI Agents
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhm, I guess this makes sense if we want different times for both upload and download, tho not sure this matters for the purpose of the upload flow, as expirations can be set separately afterwards on subsquent requests. I'll leave the choice to you :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@3nvy, thanks for the context! Here's my take:The concern is subtle but real. The completion-time download URL isn't just used immediately β
onUploadCompletehooks commonly persist it (e.g., save it to a DB), where it must survive until users actually access the file. If a route setsexpiresIn(300)for a tight upload window, the returned download URL would silently expire in 5 minutes, which could be surprising.Option A β Separate
downloadExpiresIn(recommended)This keeps upload and download TTLs independent and explicit:
Option B β Keep this PR, update docs only
If you'd prefer to ship the simplest fix now and treat
expiresInas controlling both, at minimum the stale comment onCompletionResponseand the JSDoc onS3Route.expiresIn()should be updated:β
And in
CompletionResponse:Option A is cleaner long-term; Option B is an acceptable minimal fix if scope needs to stay small. Your call!
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep @3nvy even i was thinking of a better way to get this right, working on beta branch for slightly different api structure
was thinking of doing it like this
would like your opinion!
might be good if people want to specify per route TTL, if needed they can override anytime (which is already implemented)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah that works perfectly π , is that's something your already doing for the beta api? if so Im happy to close this PR and wait for your changes :)