Skip to content

Conversation

@hmacr
Copy link
Contributor

@hmacr hmacr commented Nov 3, 2025

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

Summary by CodeRabbit

  • Bug Fixes
    • Prevent selecting past dates by enforcing a minimum date (tomorrow) on the expiration date picker.
    • Normalize date values to ISO format for consistent handling.
    • Improved date input behavior by using a date-only control and immediate input handling for more responsive updates.

@appwrite
Copy link

appwrite bot commented Nov 3, 2025

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

Teams feature lets you group users with membership management and role permissions

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 3, 2025

Walkthrough

The 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

  • Review src/lib/components/expirationInput.svelte for:
    • correct import and usage of toLocaleDateISO
    • minDate calculation (tomorrow) and application to the InputDate component
    • reactive value normalization and the on:input handler change
    • any remaining references to InputDateTime or datetime-specific logic

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: restricting past dates in the file token expiry date input component by setting minDate to tomorrow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ser-279

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ebc271e and fa714ae.

📒 Files selected for processing (1)
  • src/lib/components/expirationInput.svelte (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/lib/components/expirationInput.svelte
⏰ 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: e2e
  • GitHub Check: build

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
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

🧹 Nitpick comments (1)
src/lib/components/expirationInput.svelte (1)

77-79: Consider making minDate reactive or use const.

The minDate is 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 const instead of let if reactivity isn't needed
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 95528de and ebc271e.

📒 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 InputDateTime to InputDate and adding toLocaleDateISO are appropriate for the PR objective of restricting past dates without time components.


156-162: LGTM: Date input properly restricts past dates.

The switch to InputDate with min={minDate} correctly implements the PR objective by preventing users from selecting dates before tomorrow.

@ItzNotABug ItzNotABug merged commit acaff6f into main Nov 13, 2025
4 checks passed
@ItzNotABug ItzNotABug deleted the ser-279 branch November 13, 2025 09:52
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.

4 participants