Arrays in HTTP API responses are not sorted #327
Labels
exp/novice
Someone with a little familiarity can pick up
help wanted
Seeking public contribution on this issue
kind/enhancement
A net-new feature or improvement to an existing feature
P1
High: Likely tackled by core team if no one steps up
status/ready
Ready to be worked
Milestone
Somewhat annoying but minor issue.
When making API requests to ipfs-cluster, it seems that the response sometimes changes the order of the arrays. So the first request returns
{"peers": ["A", "B"]}
and the second one could return{"peers": ["B", "A"]}
randomly. This is a bit annoying since responses are harder to cache, since the ordering in arrays are important.Sorting the arrays before letting the HTTP endpoint respond, would solve this issue.
The endpoints I've found so far not properly sorting before responding:
/id
addresses
,cluster_peers_addresses
andipfs.addresses
/allocations
/peers
/id
so needs sorting on the same attributesI'm sure I missed others, but I've not used all API endpoints.
The text was updated successfully, but these errors were encountered: