-
Notifications
You must be signed in to change notification settings - Fork 197
fix: Restrict past dates for file token expiry #2539
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
base: main
Are you sure you want to change the base?
Conversation
ConsoleProject ID: Sites (1)
Tip Appwrite has a Discord community with over 16 000 members. |
WalkthroughThe change modifies the Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes The change is contained to a single component file with straightforward refactoring from datetime to date input. The logic additions—minimum date calculation and value normalization—are simple and follow a consistent pattern. No complex branching or multi-file coordination is required. Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
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.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/lib/components/expirationInput.svelte (1)
77-79: Consider makingminDatereactive or useconst.The
minDateis calculated once at component initialization. If the component remains mounted past midnight, the minimum date will be stale. While this is probably acceptable for typical usage, consider either:
- Making it reactive:
$: minDate = toLocaleDateISO(new Date(Date.now() + 86400000).getTime());- Using
constinstead ofletif reactivity isn't needed
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/lib/components/expirationInput.svelte(4 hunks)
⏰ 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). (2)
- GitHub Check: build
- GitHub Check: e2e
🔇 Additional comments (2)
src/lib/components/expirationInput.svelte (2)
9-10: LGTM: Import changes align with date-only input.Switching from
InputDateTimetoInputDateand addingtoLocaleDateISOare appropriate for the PR objective of restricting past dates without time components.
156-162: LGTM: Date input properly restricts past dates.The switch to
InputDatewithmin={minDate}correctly implements the PR objective by preventing users from selecting dates before tomorrow.

Task: https://linear.app/appwrite/issue/SER-279/error-creating-expired-file-token
Summary by CodeRabbit