Skip to content

lljson.sldecode can produce uncompressed uuids #47

@canny

Description

@canny

lljson has inconsistent behavior. I think these should all produce an error:


print(pcall(lljson.sldecode, '"!vOops"'))

print(pcall(lljson.sldecode, '"!qOops"'))

print(pcall(lljson.sldecode, '"!uOops"'))

The first 2 produce an error:


malformed tagged vector: !vOops

malformed tagged quaternion: !qOops

But the last one produces an uncompressed uuid:


local _, u = pcall(lljson.sldecode, '"!uOops"')

print(u, typeof(u), u.bytes) -- Oops    uuid    nil

This uuid cannot be re-encoded:


print(pcall(lljson.slencode, u))


invalid UUID format for JSON encoding

Instead, sldecode should produce an error:


malformed tagged uuid: !uOops

And uncompressed uuid's should be removed from slua, it's documentation, and typechecker: https://github.com/secondlife/lsl-definitions/blob/23d46484888c1908545dc92db119613bb553af11/slua_definitions.yaml#L70


  - name: bytes

    comment: Returns the raw 16-byte binary string of the UUID, or nil if the UUID

      is not in a compressed state

    type: string?

https://secondlife.canny.io/admin/board/slua-alpha/p/lljsonsldecode-can-produce-uncompressed-uuids

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions