Skip to content

Commit 273488f

Browse files
authored
Fix: Preserve null value for "Never" expiration option (#2605)
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.
1 parent 553587e commit 273488f

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

AGENTS.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,23 @@ src/
101101
5. Before commit: `pnpm run check && pnpm run format && pnpm run lint && pnpm run test && pnpm run build`
102102
6. **Take screenshots**: For any UI changes, capture screenshots and include them in the PR description or comments before finalizing
103103

104+
## Required Pre-Completion Checklist
105+
106+
**CRITICAL**: Before finishing any work or marking a task complete, agents MUST run the following commands in order and ensure all pass:
107+
108+
1. **`pnpm run format`** - Auto-fix all formatting issues
109+
2. **`pnpm run check`** - Verify TypeScript/Svelte types (must show 0 errors, 0 warnings)
110+
3. **`pnpm run lint`** - Check code style (ignore pre-existing issues in files you didn't modify)
111+
4. **`pnpm run test`** - Run all unit tests (all tests must pass)
112+
5. **`pnpm run build`** - Ensure production build succeeds
113+
114+
If any command fails:
115+
116+
- **Format/Lint**: Run `pnpm run format` to auto-fix, then re-check
117+
- **Type errors**: Fix all TypeScript errors in files you modified
118+
- **Test failures**: Fix failing tests or ensure failures are unrelated to your changes
119+
- **Build failures**: Debug and resolve build issues before proceeding
120+
121+
**Never skip these checks** - they are mandatory quality gates before any work is considered complete.
122+
104123
**Trust these instructions** - only search if incomplete/incorrect. See CONTRIBUTING.md for PR conventions. Use `--frozen-lockfile` always. Docker builds: multi-stage, final image is nginx serving static files from `/console` path.

src/lib/components/expirationInput.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@
134134
value = expirationSelect === 'custom' ? expirationCustom : expirationSelect;
135135
}
136136
137-
value = toLocaleDateISO(new Date(value).getTime());
137+
// Only convert to ISO date if value is not null
138+
if (value !== null) {
139+
value = toLocaleDateISO(new Date(value).getTime());
140+
}
138141
}
139142
140143
$: helper =

src/routes/(console)/project-[region]-[project]/overview/(components)/create.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
let isSubmitting = writable(false);
2525
2626
let scopes: string[] = [];
27-
let name = '',
28-
expire = '';
27+
let name = '';
28+
let expire: string | null = null;
2929
3030
async function create() {
3131
try {

0 commit comments

Comments
 (0)