-
Notifications
You must be signed in to change notification settings - Fork 198
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
Conversation
Console (appwrite/console)Project ID: Tip Teams feature lets you group users with membership management and role permissions |
WalkthroughThe change updates src/lib/components/expirationInput.svelte to replace the InputDateTime component with InputDate, add a new import toLocaleDateISO, compute a tomorrow-based minDate and expose it as the input's min attribute, switch the custom input event from on:change to on:input, and normalize emitted/updated values to ISO date format using toLocaleDateISO in the reactive update block. Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
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