apache / apache/couchdb

Externalise Erlang Term things (_revs, replication _ids)

Open
#1,530 2 comments 0 reactions 0 assignees View on GitHub
roadmap
Dominant language
Erlang
Stars
7k
Forks
1.1k
Avg merge
1d 16h
Merged PRs (30d)
9

Description

@nolanlawson:
>Prior discussion in Pouch: pouchdb/pouchdb#4642

@davisp:
>I just remembered that I wrote a Python JSON canonicalizer a long time ago. The basics are: sort keys when serializing, no added whitespace, strings are Unicode NFD normalized encoded in UTF-8, and floats are serialized using dtoa.c (or similarly compatible code, ie, 1.1 is printed as 1.1, not as 1.100000000000000088817842).
>
>For strings I wonder if it'd be better to requiring anything that's non-ascii to be encoded using the \u escape sequences.
>
>I should probably add a link to the thing: https://github.com/davisp/jsonical

@nolanlawson:
> Yeah in JS a popular one is: https://github.com/substack/json-stable-stringify

We fixed some of this with a recent CVE, but it doesn't address the original request.

Contributor guide

Open the contributing guide

Research direction

Start by reading the prior PouchDB discussion linked in the issue and comparing it with the referenced jsonical and json-stable-stringify approaches. The issue does not name files, tests, or a precise acceptance criterion; done would require agreeing on and implementing the original externalization and canonicalization request beyond the CVE fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
erlang
Domain
databases
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.