Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alexander-yakushev opened this issue Mar 13, 2025 · 0 comments
Closed

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

alexander-yakushev opened this issue Mar 13, 2025 · 0 comments
Labels

Comments

@alexander-yakushev
Copy link
Member

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"
@bbatsov bbatsov added the bug label Mar 16, 2025
jasalt added a commit to jasalt/phel-nrepl that referenced this issue Mar 30, 2025
Required code copied to util.phel from jasalt/phel-bencode library for now

clojure-emacs/cider#3786
iarenaza added a commit to iarenaza/cider that referenced this issue Apr 20, 2025
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.

[Re: clojure-emacs#3786]
iarenaza added a commit to iarenaza/cider that referenced this issue Apr 20, 2025
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.

[Re: clojure-emacs#3786]
iarenaza added a commit to iarenaza/cider that referenced this issue Apr 21, 2025
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.

[Re: clojure-emacs#3786]
iarenaza added a commit to iarenaza/cider that referenced this issue Apr 21, 2025
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.
iarenaza added a commit to iarenaza/cider that referenced this issue Apr 22, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants