ssbc / ssb-tribes2

SSB private groups with ssb-db2
8 stars 1 forks source link

Members tangle should init at some point #33

Closed Powersource closed 1 year ago

Powersource commented 1 year ago

We have this issue for making the member tangle work properly https://github.com/ssbc/ssb-tribes2/issues/28 which i imagine means setting the previous correctly. But until we do that we shouldn't break stuff for ourselves in the future. Currently when a member is added we make the member tangle point at the group root msg.

https://github.com/ssbc/ssb-tribes2/blob/133fcefe9a2c910c0226f2b284f9c6688518a805/index.js#L135-L138

But that doesn't really make sense since in that root message we don't init the member tangle

https://github.com/ssbc/ssb-tribes2/blob/133fcefe9a2c910c0226f2b284f9c6688518a805/index.js#L49-L54

Easiest way to fix this is to add

members: { root: null, previous: null }

after line 52. It would maybe make more sense to only init it once we need it (on first member add i.e. admin adding themselves) but that's slightly more complicated.

Powersource commented 1 year ago

@mixmix @staltz

staltz commented 1 year ago

Related to the membership document.

mixmix commented 1 year ago

It could init indedependantly if you want @Powersource I think hanging it off the group/init doesn't hurt much either, that message is easy enough to filter out. Potatoes Pattatahs IMO

Powersource commented 1 year ago

Yeah I just don't think we should get used to stuff always being init'ed on the root msg, since we won't be able to update that one retroactively in the future when/if we add more new tangles to a group.

Powersource commented 1 year ago

thinking about it a bit more (and looking at the code that'd have to be changed :P ) maybe doesn't hurt to point this as well to the init msg, then we e.g. get a blank initial state.