-
Notifications
You must be signed in to change notification settings - Fork 198
Fix: Preserve null value for "Never" expiration option #2605
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 Function scopes give you fine-grained control over API permissions |
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
- Fixed reactive block in expirationInput.svelte to check for null before converting to ISO date - When "Never" is selected, value now remains null instead of being converted to '1970-01-01' - This allows the API to correctly handle null expiration dates for API keys and file tokens Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
stnguyen90
left a 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.
@copilot the file token will generate now, but the API key still won't.
- Updated initialization logic to handle both null and invalid date values (including empty strings) - Removed the check for expirationSelect !== null to allow proper initialization when "Never" is selected - Added isValidDate check before ISO date conversion to prevent converting invalid dates to 'n/a' - This fixes the issue where API keys couldn't be created with "Never" expiration when the parent component initializes expire as an empty string Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
Fixed in commit c772abc. The issue was that API key creation initializes Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
stnguyen90
left a 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.
@copilot instead of changing
|
@copilot Run the formatter because there is a lint error. |
Added a "Required Pre-Completion Checklist" section that instructs agents to: - Always run format, check, lint, test, and build before finishing - Fix any failures before marking work complete - Never skip these mandatory quality gates This addresses the requirement to ensure all code changes are properly validated. Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
Done in commit a17bb09. Ran Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
stnguyen90
left a 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.
@copilot please also update this branch with the latest from main to hopefully fix the CI tests
- Changed API key create component to initialize `expire = null` instead of `expire = ''` - Reverted complex invalid date handling in ExpirationInput component - Kept only the essential null value handling in ExpirationInput - This matches the approach used in file token component and is simpler This addresses reviewer feedback to handle the issue at the source (parent component) rather than making the ExpirationInput component more complex. Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com>
Done in commit 0d77f88. Branch has been updated with the latest from main. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|

Fix: Invalid
expireparam when creating API Key or File TokenThis PR fixes the bug where selecting "Never" as the expiration for API Keys or File Tokens results in an invalid
expireparameter being sent to the API.Root Cause
The reactive block in
ExpirationInputunconditionally converted all values to ISO date strings:When "Never" was selected (
value = null), this converted it to'1970-01-01'(epoch date), which failed API validation.Solution
Made two changes:
ExpirationInput component: Added null check before ISO date conversion
nullvalues for "Never" expirationAPI key creation component: Changed initialization from empty string to null
Impact
Fixes expiration handling across all components using
ExpirationInput:Additional Changes
Verification
Fixes #2604
Original prompt
expireparam when creating API Key or File Token #2604✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.