Skip to content
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

Leftovers for private groups #67

Merged
merged 24 commits into from
Nov 23, 2020
Merged

Leftovers for private groups #67

merged 24 commits into from
Nov 23, 2020

Conversation

cryptix
Copy link
Member

@cryptix cryptix commented Nov 11, 2020

TODO

  • re-index when receiving group join messages

Done

move keys to private/keys (bed7170)

this was confusing since there is also a keys.go in the root of the repo for the signing keypair.

right now these keys are used for private messages, so move the package there to make this clearer.

rename sbot.RootLog to sbot.ReceiveLog (ad164d7)

the stream of messages as they arrive

The old term wasn't saying much and also collided with tangle root.

sort by timestamp support (61c5c03)

supports three domains: claimed, received and feed sequence(*)

also supports createFeedStream and messagesByType sorting by claimed timestamp. (TODO: createUserStream)

*: this will become important later once feeds are received out of order.

ditch func (r ref) StorageRef() librarian.Addr from refs package and use TFK instead

See 5ce3d02 for the gory details. tldr: the refs package has fewer internal specifics from go-ssb.
(not merged yet, uses with-branches branch. to be merged with the tangle sort fixes)

fix tangle sort, add Heads() MessageRefs (69e6790)

go.mindeco.de/[email protected] can sort slices of TangledPost now. It's a bit cumbersome to use because of go's type system. A slice of refs.Message needs to be copied into a slice of refs.TangledPost before that can be assigned to (refs.ByPrevious).Items to be sorted.

start interop testing against ssb-tribes

I added two cases to the tests that run against the javascript implementation. One where the JS side creates a group and invites the Go side, the other one does it in reverse (Go creates and invites JS).

This helped me thin out some problems in the DM key derivation (used for 1:1 messages and group invites) and that the cloaked groupID is actually using the read key not the group key for the derivation. So this work now, which is great!

On the negative side, i found two issues that feel like races on the JS side. They both only show if you run the tests over and over again (simply done using go test -count 100). I opened ssbc/ssb-db#316 and ssbc/ssb-db#317 respectively.

add private:bool query parameter

Added to messagesByType and tangles.replies but there is lot's TODO about it still. Before I add it to createLogStream I want to find a solution to the following but that can happen later.
First the code is terrible repetitive and doesn't fold in nicely with the existing margaret query code, similar to the live:bool code there now are two versions to drain a query to muxrpc. Consequently it isn't straight forward to add this to the internal indexing, to support private contact messages for instance.

Another missing feature from the application perspective is how to publish. As it stands an application needs to use groups.publishTo(groupID, { /* content */ }) and this doesn't play nice with existing clients which use publish({content, recps}), looking at the recps array to do the right thing. Using the existing code would leak messages.

this was confusing since there is also a keys.go in the root of the repo for the signing keypair.

right now these keys are used for private messages, so move the package there to make this clearer.
> the stream of messages as it arrive

the old term wasn't good, also collided with tangle root.
untyped messages
supports three domains: claimed, received and feed sequence(*)

also supports createFeedStream and messagesByType sorting by claimed timestamp

*: this will become important later once feeds are received out of
order.
this function taints the package with internal implementation assumptions.
also with TFK the original StorageAddr is obsolete.

this also drops some old migration code which shouldnt be in use anymore.
fixed bugs in direct-message key derivation

TODO: lot's of debug print to remove
fix index address and setting Heads() for loose ends
renamed muxrpc command renamed to tangles.replies to make space for tangles.heads.

also started a muxrpc managment API for groups (groups.create,
    groups.invite, groups.publishTo).

TODO: support get({private:true, id})
@cryptix
Copy link
Member Author

cryptix commented Nov 23, 2020

I will do re-indexing as a follow-up PR. This one is big enough as it is.

@cryptix cryptix merged commit f5bdbb1 into private-groups-3 Nov 23, 2020
@cryptix cryptix deleted the private-groups-4 branch November 23, 2020 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant