Last active
September 24, 2020 23:42
-
-
Save matildepark/84a044cef3f52c78db61f2d487a3603e to your computer and use it in GitHub Desktop.
links: graph-store migration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
// September 24 2020 | |
// If you are writing an application for Urbit / Landscape that uses the Links suite of applications, | |
// the following comparison flags a change in how the data is expressed in JSON. Please amend any clients appropriately. | |
// Given I own a single collection with a single link in it, with itself a single comment (saying "Comment"), the following data is expressed. | |
// old structure | |
{ | |
"linkComments": { | |
"/collection-6478": { | |
"http://4chan.org": { | |
"0": [ | |
{ | |
"ship": "haddef-sigwen", | |
"time": 1600989571500, | |
"udon": "Comment" | |
} | |
], | |
"local": { | |
"0": false | |
}, | |
"totalItems": 1, | |
"totalPages": 1 | |
} | |
} | |
}, | |
"linkListening": ["/collection-6478"], | |
"links": { | |
"/collection-6478": { | |
"0": [ | |
{ | |
"commentCount": 0, | |
"ship": "haddef-sigwen", | |
"time": 1600989542513, | |
"title": "4chan", | |
"url": "http://4chan.org" | |
} | |
], | |
"local": { "0": false }, | |
"totalItems": 1, | |
"totalPages": 1, | |
"unseenCount": 0 | |
} | |
}, | |
"linksSeen": { | |
"/collection-6478": { | |
"http://4chan.org": true | |
} | |
} | |
} | |
// new structure, using graph-store | |
{ | |
"graphs": { | |
"zod/collection": Map[ | |
0: { | |
key: 1600986579797, | |
value: { | |
children: Map[ | |
1600990794468: { | |
children: Map[], | |
post: { | |
author: "zod", | |
contents: [ | |
{text: "Comment"} | |
], | |
hash: null, | |
index: "/1600986579797/1600990794468", | |
signatures: [], | |
"time-sent": 1600990794468 | |
} | |
} | |
], | |
post: { | |
author: "zod", | |
contents: [ | |
{text: "4chan"}, | |
{url: "http://4chan.org"} | |
], | |
hash: null, | |
index: "/1600986579797", | |
signatures: [], | |
"time-sent": 1600986579797 | |
} | |
} | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment