~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

A space can be left half made, then cannot be changed or deleted

Closed
Closed chadtmiller.com opened this issue 0 comments

What happened

the space row is made (host.create_space) before its access record is written, and the access record is written before its index entry. credentialScopes is copied unchecked, so createSpace {..., skey: "rides", credentialScopes: [{"role": "admin", "scopes": 1.5}]} makes the space, and the access write then fails in drisl::check_record with "not an integer". The space now exists with no access record and no index entry. updateSpace and deleteSpace answer SpaceNotFound (own_space needs the access record), and a retry with the same skey answers SpaceAlreadyExists, so the key is lost for good. Separately, for a space that has an access record but no index entry, updateSpace with name and readableBy writes the access change first, then answers SpaceNotFound from entry_of.

How to see it

Read against docs/fresh at 4636e6d, the code at: group_spaces.rs:121-147 (create_space), :200-214 (update_space), :235 (delete_space → entry_of). Paths are under crates/group-host/src unless they say otherwise. Severity: low.

What you expected

Check the access record (drisl::check_record) and look up the index entry before any write. On a failed write, end the space just made (end_space) before answering the error.

Where

The host, as built from 4636e6d. Found while checking the docs against the code.