[Feature Request] llLinksetDataWriteWithValidation()
tracked
Lucia Nightfire
Linkset Data allows multiple scripts in the same linkset to read/create/update/delete data.
We currently do not have any LSD functions with an append validation protocol.
Experience KVP updating has a validation protocol w/ feedback which can address race conditions between scripts in the same linkset, different objects in the same region or different objects grid-wide.
The following function satisfies the need stated above for LSD:
integer llLinksetDataWriteWithValidation(string name, string value, string pass, string original_value)
A new failure code constant LINKSETDATA_VALIDATION with value 6 will be needed for this function.
Functionality:
- If name does NOT exist and value is NOT an empty string and original_value is an empty string, the entry is created and 0 is returned, else, 6 is returned.
- If name exists and value is NOT an empty string and original_value matches name's current value and pass matches name's current pass, the entry is updated and 0 or 5 is returned, else, 6 is returned.
- If name exists and value is an empty string and original_value matches name's current value and pass matches name's current pass, the entry is deleted and 0 is returned, else, 6 is returned.
Other typical check failures such as empty name, name not found, pass mismatch, etc. will return the same values as they do now before validation handling is done.
The server is actually already doing these checks in the background to determine what integer value to return with exiting LSD functions. There's just, currently, no validation protection.
This feature offers validation protection for creates, updates and deletes which is a must in an environment where multiple scripts can potentially modify an entry at the same time creating race conditions.
Since it has password input, this function becomes a defacto all-in-one append function for creates, updates and deletes, something even KVP currently doesn't offer.
Log In
Spidey Linden
tracked
Issue tracked. We have no estimate when it may be implemented. Please see future updates here.
WolfGang Senizen
At this point ll really should just make
llLinksetDataWriteAdvanced
There are a bunch of decent suggestions for LinksetData and we shouldnt need to have endless new functions that then need even more functions to combine functionality.
We could have this instead
llLinksetDataWriteAdvanced(
"key",
"value",
[
LSD_MODE, LSD_MODE_REPLACE,
LSD_VALIDATE, LSD_VALIDATE_EQUAL, "old_value",
LSD_PASSWORD, "secret"
]
)
OR
llLinksetDataWriteAdvanced(
"key",
"value3:",
[
LSD_MODE, LSD_MODE_APPEND,
LSD_VALIDATE, LSD_VALIDATE_MATCH, ".*value2:$",
LSD_PASSWORD, "secret"
]
)
Andromeda Quonset
This seems reasonable. I wonder, is there a simple way to do the opposite action of append?
Lucia Nightfire
Andromeda Quonset You might need to explain what you mean by "opposite action of append".
Andromeda Quonset
Lucia Nightfire If Append is adding an item, the opposite would remove an item.
Lucia Nightfire
Andromeda Quonset LSD "Write" functions are capable of deletes using null strings for key values.