Some of those are more cosmetics but they annoyed me for a while and I hope to make the codebase more approachable by having consistent names and the like.
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 only for private messages, so move the package there to make this clearer.
the stream of messages as they arrive
The old term wasn't saying much and also collided with tangle root.
cc https://github.com/ssb-ngi-pointer/jitdb/issues/50
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/ssb-refs@v0.1.0
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.
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 since they would just be posted as-is. (edit: this is no longer the case, as of f531eb9
the muxrpc publish
call snoops into the content object to look for an array or recps
to do the right thing.