Repository navigation
fix(public-links): the Edit dialog keeps the expiry it was given, and can remove it (#3584) - #3842
Merged
Merged
Conversation
… can remove it (#3584) The datetime-local input has no time zone: it shows and returns local wall-clock time. editLink loaded the stored UTC string's own characters (slice(0, 16)) and saveLink read the value back as local, so every untouched Save moved the expiry by the browser's UTC offset (east of UTC a link expired early, west of UTC late). A cleared field sent nothing, and the update read a missing expires_at as "unchanged", so an expiry could not be removed. - utils/timestamps.toDatetimeLocalInput shows the stored instant in local time; the dialog sends the expiry only when it was changed (an untouched Save omits it), as null when cleared, and as the UTC instant otherwise. - PUT /public-links/{id}: an expires_at the request SENT as null or empty clears the expiry (model_fields_set); one left out is kept, so a rename or the enable toggle never clears it. db.update_public_link takes clear_expiry. Mutations: reverting PublicLinksPanel.vue turns 7 frontend tests red (untouched Save in five zones, local display, clearing); reverting the router turns 6 backend tests red. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…xpiry # Conflicts: # tests/registry.json
obasilakis
approved these changes
Oct 22, 2026
obasilakis
left a comment
Contributor
There was a problem hiding this comment.
API contract is right: model_fields_set means null/"" clears expiry and a missing field keeps it; the toggle sends {enabled} only; no MCP caller. Frontend sends expiry only when changed, null when cleared, UTC/local conversion correct. Backend: 9 pass on the branch, 6 fail with dev's router. Frontend spec not run locally.
Minor:
docs/memory/feature-flows/public-agent-links.md:290— add a line on the new PUT semantics (nullclears, missing keeps).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
datetime-localinput shows and returns local wall-clock time, with no time zone. The dialog loaded the stored UTC string's characters into it (slice(0, 16)) and read the value back as local. So every untouched Save shifted the expiry by the browser's UTC offset: east of UTC a link expired early, west of UTC late.utils/timestamps.toDatetimeLocalInput.expires_at: null.PUT /api/agents/{name}/public-links/{id}now tells "sent as null or empty" (clear it) apart from "not sent" (keep it) viamodel_fields_set, so a rename or the enable toggle never clears an expiry.db.update_public_linkgainsclear_expiry.Changes
src/frontend/src/components/PublicLinksPanel.vue(editLink,saveLink) andsrc/frontend/src/utils/timestamps.js(toDatetimeLocalInput).src/backend/routers/public_links.py(update_public_link)src/backend/db/public_links.pyand thedatabase.pyfacade (clear_expiry)src/frontend/tests/unit/publicLinkExpiry.spec.js(19),tests/unit/test_3584_public_link_clear_expiry.py(9), and a registry entry.Test Plan
npx vitest run tests/unit/publicLinkExpiry.spec.js: 19 pass.expires_atin all five zones; clearing the field sendsnull; a typed value is sent as its UTC instant.cd tests && pytest unit/test_3584_public_link_clear_expiry.py unit/test_3583_public_link_expiry.py: 25 pass.PublicLinksPanel.vueturns 7 frontend tests red; reverting the router turns 6 backend tests red.npm run test:unit: 387 files / 6149 tests, ratchets included.Fixes #3584
🤖 Generated with Claude Code