Skip to content

nrepl-bencode doesn't sort dictionaries by key #3786

Closed
@alexander-yakushev

Description

@alexander-yakushev

From https://clojurians.slack.com/archives/C17JYSA3H/p1741890145125339.

It appears that CIDER doesn't adhere to Bencode spec which requires dictionary keys to be sorted alphabetically. This hasn't been a problem so far because the bencode reader on nREPL side doesn't validate the order of keys. Still, it will be rigorous to produce correct values according to the selected format.

Expected behavior

(nrepl-bencode '("b" 2 "a" 1))
=> "l1:ai1e1:bi2ee"

Actual behavior

(nrepl-bencode '("b" 2 "a" 1))
=> "l1:bi2e1:ai1ee"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions