Repository navigation
feat(console): the tags of a resource can be edited - #477
Conversation
The `updateTags` capability has been advertised since the capability existed, and the console had no way to reach it, so the tags a resource showed were the ones it would keep. KMS declares the capability and the console never rendered it. The resource panel now carries the control: the tags a resource has, editable, saved through the adapter's own `updateTags`, which is where a key with a null value is one whose tag is removed. The control appears only for a service whose schema declares the capability, so a service that cannot edit its tags shows none. The tag reading and the change between the tags a resource has and the ones the editor holds live in one place, shared with the panel that shows them.
The editor asked for a query that nothing reads, so the tags a resource showed were the ones it had before the edit. The inspector shows the resource's own query and the list shows the row, and both carry the tags, so both are asked again.
a3d524d to
30fc241
Compare
…s own The route cast the request body to a map of tag changes without checking it, so a body that was an array, or one whose values were not strings, reached the cloud. The body is checked now, and a fault of the caller is refused here. A tag named `__proto__` was lost: assigning it to a plain object reached the inherited setter rather than making a property of the object's own. The changes are built through a map and made into an object at the end, on both sides of the request, so the tag is a tag. The editor held still while it was saving, because the editor is closed when the save succeeds: a change made while the request was in flight would have been lost without a word.
|
A local review of this pull request with The request body was not checked. The generic a request is cast to is only a A tag named The editor could be edited while it was saving. The editor is closed when Each has a test that fails without the fix: the route refuses the bodies it Checks: |
[Medium impact] The PR appears safe to merge; all three previous findings are fixed.
|
The editor compared the draft against the tags the resource has now, and a tag that arrived while the form was open was not one the form had, so saving sent it as a removal and deleted it. The tags the editing began with are kept with the draft, and the comparison is against those. The list was refreshed by a query key nothing reads, so the rows kept the tags they had after a save. The account is captured when the save is made, so an account switch while the request is in flight does not refresh another account's resources. Two rows naming the same tag are refused, with the key named: the changes between the tags kept only the last of them, so a save could succeed and silently drop a value the form still showed.
|
Thank you for this No blockers from my side. |
Summary
The
updateTagscapability has been advertised since the capability existed, andthe console had no way to reach it, so the tags a resource showed were the ones it
would keep. KMS declares the capability and the console never rendered it.
The resource panel now carries the control: the tags a resource has, editable,
saved through the adapter's own
updateTags, which is where a key with a nullvalue is one whose tag is removed. The control appears only for a service whose
schema declares the capability, so a service that cannot edit its tags shows
none.
This is the shared half of the payment cryptography work, and it stands on its
own: it needs nothing from #476, and #476 needs nothing from it.
Type of change
fix:)feat:)feat!:orfix!:)Area
packages/frontend)packages/api)Verification
Against a local Floci core (
:4566):and a tag removed, and the key comes back with the three;
updateTagsshows no control, andthe API answers the request with
501 operation_not_supported, which is theerror the service layer raises for an adapter without the method;
404;own query and for the list, which are the two that carry them.
Checks:
pnpm lint,pnpm type-check,pnpm test(2904 API tests, 3 of themnew in
clouds.tags.test.ts, and 321 frontend tests, 6 of them new inresourceTags.test.ts) andpnpm buildpass.Note on the shared surface
The control lands in the shared resource panel, which the repository's rules
ask to change only for an issue that came from an accepted Discussion. The
argument for doing it directly is that the capability was already declared and
the console simply could not reach it, so this is the control the schema always
promised. Happy to split the API half out if the panel is the part that needs
the discussion.
Checklist
pnpm lint,pnpm type-check,pnpm test, andpnpm buildpass locallybun testinpackages/api, vitest inpackages/frontend)