• Kirill Smelkov's avatar
    go/neo/proto: Don't require deletedAt to be present in OID_NOT_FOUND · a2b8516c
    Kirill Smelkov authored
    Providing deletedAt in addition to oid in OID_NOT_FOUND error is NEO/go extension.
    NEO/py sends only OidNotFound(oid):
    
    https://lab.nexedi.com/nexedi/neoppod/blob/v1.12-0-g6332112c/neo/storage/handlers/client.py#L70-72
    
    -> decode deletedAt only if it is present.
    
    Since inspecting NEO/py codebase turned out that message always comes
    with oid, remove the "abusing" words about this approach to convey oid
    via error message for OID_NOT_FOUND and OID_DOES_NOT_EXIST.
    
    Without this patch TestLoad was failing as
    
        === RUN   TestLoad/py
        I: runneo.py: /tmp/neo124851059/1: started master(s): 127.0.0.1:19681
            xtesting.go:306: load 0285cbac258bf265:0000000000000000: returned err unexpected:
                have: neo://1@127.0.0.1:19681: load 0285cbac258bf265:0000000000000000: OID_NOT_FOUND: 0000000000000000
                want: neo://1@127.0.0.1:19681: load 0285cbac258bf265:0000000000000000: 0000000000000000: object was not yet created
            xtesting.go:306: load 0285cbac3d0369e5:0000000000000001: returned err unexpected:
                have: neo://1@127.0.0.1:19681: load 0285cbac3d0369e5:0000000000000001: OID_NOT_FOUND: 0000000000000001
                want: neo://1@127.0.0.1:19681: load 0285cbac3d0369e5:0000000000000001: 0000000000000001: object was not yet created
            xtesting.go:306: load 0285cbac41b4e832:0000000000000002: returned err unexpected:
                have: neo://1@127.0.0.1:19681: load 0285cbac41b4e832:0000000000000002: OID_NOT_FOUND: 0000000000000002
                want: neo://1@127.0.0.1:19681: load 0285cbac41b4e832:0000000000000002: 0000000000000002: object was not yet created
            xtesting.go:306: load 0285cbac4666667f:0000000000000003: returned err unexpected:
                have: neo://1@127.0.0.1:19681: load 0285cbac4666667f:0000000000000003: OID_NOT_FOUND: 0000000000000003
                want: neo://1@127.0.0.1:19681: load 0285cbac4666667f:0000000000000003: 0000000000000003: object was not yet created
            xtesting.go:306: load 0285cbac4fc96318:0000000000000004: returned err unexpected:
                have: neo://1@127.0.0.1:19681: load 0285cbac4fc96318:0000000000000004: OID_NOT_FOUND: 0000000000000004
                want: neo://1@127.0.0.1:19681: load 0285cbac4fc96318:0000000000000004: 0000000000000004: object was not yet created
            xtesting.go:306: load 0285cbac547ae165:0000000000000005: returned err unexpected:
                have: neo://1@127.0.0.1:19681: load 0285cbac547ae165:0000000000000005: OID_NOT_FOUND: 0000000000000005
                want: neo://1@127.0.0.1:19681: load 0285cbac547ae165:0000000000000005: 0000000000000005: object was not yet created
            xtesting.go:306: load 0285cbac628f5c4b:0000000000000006: returned err unexpected:
                have: neo://1@127.0.0.1:19681: load 0285cbac628f5c4b:0000000000000006: OID_NOT_FOUND: 0000000000000006
                want: neo://1@127.0.0.1:19681: load 0285cbac628f5c4b:0000000000000006: 0000000000000006: object was not yet created
            xtesting.go:306: load 0285cbaca444447f:0000000000000007: returned err unexpected:
                have: neo://1@127.0.0.1:19681: load 0285cbaca444447f:0000000000000007: OID_NOT_FOUND: 0000000000000007
                want: neo://1@127.0.0.1:19681: load 0285cbaca444447f:0000000000000007: 0000000000000007: object was not yet created
            xtesting.go:306: load 0285cbacbbbbbbff:0000000000000008: returned err unexpected:
                have: neo://1@127.0.0.1:19681: load 0285cbacbbbbbbff:0000000000000008: OID_NOT_FOUND: 0000000000000008
                want: neo://1@127.0.0.1:19681: load 0285cbacbbbbbbff:0000000000000008: 0000000000000008: object was not yet created
            xtesting.go:306: load 0285cbad80da7498:0000000000000009: returned err unexpected:
                have: neo://1@127.0.0.1:19681: load 0285cbad80da7498:0000000000000009: OID_NOT_FOUND: 0000000000000009
                want: neo://1@127.0.0.1:19681: load 0285cbad80da7498:0000000000000009: 0000000000000009: object was not yet created
    a2b8516c
error.go 2.55 KB