stratumn / go-core

Stratumn's core utilities to create decentralized applications and networks
Apache License 2.0
0 stars 0 forks source link

postgresstore: pagination does not work with multi evidences #432

Open alexppxela opened 6 years ago

alexppxela commented 6 years ago

Expected behavior

Pagination does not care about the number of evidences

Actual behavior

If pagination truncates evidences of the same link, pagination will return a segment with partial evidences. Client will ask for more segments (offset incremented) and will retrieve a segment with the same link with other evidences

Steps to reproduce the behavior

link_hash map_id process
123...123 "FOO" "FAIL"
ABC...ABC "BAR" "FAIL"
link_hash provider
123...123 "btc:test3"
123...123 "btc:main"
123...123 "eth:Ropsten"

Results:

FindSegments(SegmentFilter{
    Pagination: Pagination{
        Offset: 0,
        Limit:  2,
    },
    Process: "FAIL",
})

Will return 123...123

FindSegments(SegmentFilter{
    Pagination: Pagination{
        Offset: 2,
        Limit:  2,
    },
    Process: "FAIL",
})

Will return 123...123 and ABC...ABC