-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add publishing of message type for exclusion of members #72
Conversation
Powersource
commented
Jul 21, 2023
•
edited
Loading
edited
- Stop relying on keyring for listing members #74 Don't use member functions from keyring #75
- Test that the member gets excluded for the excluder Person excluding should see exclusion of members #73
- Excluded members should exclude themselves #80
- Test that a third member sees the exclusion and does something about it
- Fix the member tangle #76
- Allow being added back into a group after exclusion #79
i guess tests are just flaky or something? |
all tests passing locally |
|
||
tangles: { | ||
members: { root: groupInitMsg.key, previous: [groupInitMsg.key] }, | ||
group: { root: groupInitMsg.key, previous: [...exclude.content.tangles.group.previous] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this cheating?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would say no.
buuut, there seemed to be two entries in the array, which is weird
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌶️ should be same as tangles.members.previous
I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mm yeah but problem is the members tangle doesn't work yet. there was another review comment about this, i'll make an issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
putting this as a later task if that's fine
} | ||
|
||
await Promise.all([ | ||
p(kaitiaki.close)(true), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tribes.excludeMembers
✔ creates group
kaitiaki ─> new person
1 [?]
2 [?]
3 group/add-member ─ new person, undefined
/home/me/prj/ssb/ssb-tribes/index.js:108
if (err) throw err
^
Error [ReadError]: Database is not open
at maybeError (/home/me/prj/ssb/ssb-tribes/node_modules/.pnpm/[email protected]/node_modules/levelup/lib/levelup.js:339:32)
at LevelUP.put (/home/me/prj/ssb/ssb-tribes/node_modules/.pnpm/[email protected]/node_modules/levelup/lib/levelup.js:211:7)
at registerAuthor (/home/me/prj/ssb/ssb-tribes/node_modules/.pnpm/[email protected]/node_modules/ssb-keyring/models/membership.js:45:8)
at /home/me/prj/ssb/ssb-tribes/node_modules/.pnpm/[email protected]/node_modules/ssb-keyring/models/membership.js:26:41
at /home/me/prj/ssb/ssb-tribes/node_modules/.pnpm/[email protected]/node_modules/pull-stream/throughs/async-map.js:32:13
at /home/me/prj/ssb/ssb-tribes/node_modules/.pnpm/[email protected]/node_modules/pull-stream/sources/values.js:21:7
at next (/home/me/prj/ssb/ssb-tribes/node_modules/.pnpm/[email protected]/node_modules/pull-stream/throughs/async-map.js:27:9)
at next (/home/me/prj/ssb/ssb-tribes/node_modules/.pnpm/[email protected]/node_modules/pull-stream/sinks/drain.js:22:11)
at /home/me/prj/ssb/ssb-tribes/node_modules/.pnpm/[email protected]/node_modules/pull-stream/sinks/drain.js:37:15
at /home/me/prj/ssb/ssb-tribes/node_modules/.pnpm/[email protected]/node_modules/pull-stream/throughs/async-map.js:39:20 {
[cause]: undefined
}
Node.js v18.16.0
✔ kaitiaki excluded everyone
test count(48) != plan(null)
Failed tests: There was 1 failure
✖ undefined) undefined
total: 48
passing: 48
failing: 1
2.529 s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed by adding a 500ms wait at the end and a t.end(), weird 4c98a4a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we never needed t.end() in promise tests in tribes2, i wonder what's the difference. and what exactly is happening in the 500ms wait
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that error says that levelDB is trying to do something with a DB which is not open.
at registerAuthor (/home/me/prj/ssb/ssb-tribes/node_modules/.pnpm/[email protected]/node_modules/ssb-keyring/models/membership.js:45:8)
it's trying to call registerAuthor
in the keyring... but I guess the keyring was closed (unless you waited 500ms)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the keyring open again after 500ms? that's really confusing
All tests passing locally. I guess before un-marking as draft, I should also add basic "consumption" of the msg. I'll add tasks above. |
hmm maybe for "exclusion v1" i can keep this branch as a feature branch. then we could review and approve this branch in its current state, then the other tasks i've listed above can get their own PRs based on this PR. or something like that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Doesn't have (that I can see) any changes to the listeners which react to the group/exclude-member
yet
tangles: { | ||
members: { | ||
root, | ||
previous: [root] // TODO calculate previous for members tangle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made an issue for this that we can do later #76
const kaitiaki = Server() | ||
const newPerson = Server() | ||
|
||
const name = id => { | ||
if (id === kaitiaki.id) return 'kaitiaki ' | ||
if (id === newPerson.id) return 'new person' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
latest scuttle-testbot supports this
const kaitiaki = Server() | |
const newPerson = Server() | |
const name = id => { | |
if (id === kaitiaki.id) return 'kaitiaki ' | |
if (id === newPerson.id) return 'new person' | |
} | |
const kaitiaki = Server({ name: 'kaitiaki' }) | |
const newPerson = Server({ name: 'new-person' }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This, however, is not using the latest scuttle-testbot 😉
groupId, authorIds, {} | ||
) | ||
|
||
await p(replicate)({ from: kaitiaki, to: newPerson, live: false, name }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await p(replicate)({ from: kaitiaki, to: newPerson, live: false, name }) | |
await p(replicate)({ from: kaitiaki, to: newPerson, live: false }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keeping this until we upgrade the testbot in another PR
excludes: authorIds, | ||
|
||
tangles: { | ||
members: { root: groupInitMsg.key, previous: [groupInitMsg.key] }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌶️ I think the previous should be the id of the invite message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
tangles: { | ||
members: { root: groupInitMsg.key, previous: [groupInitMsg.key] }, | ||
group: { root: groupInitMsg.key, previous: [...exclude.content.tangles.group.previous] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌶️ should be same as tangles.members.previous
I think
} | ||
|
||
await Promise.all([ | ||
p(kaitiaki.close)(true), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that error says that levelDB is trying to do something with a DB which is not open.
at registerAuthor (/home/me/prj/ssb/ssb-tribes/node_modules/.pnpm/[email protected]/node_modules/ssb-keyring/models/membership.js:45:8)
it's trying to call registerAuthor
in the keyring... but I guess the keyring was closed (unless you waited 500ms)
Co-authored-by: mix irving <[email protected]>
thanks for the review ❤️
yeah i'm thinking that's for the other PRs that would merge into this one before we merge this |
Co-authored-by: mix irving <[email protected]>
Co-authored-by: mix irving <[email protected]>
…keyring-no-members
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
7903304
to
f078721
Compare
Merged via : #83 |
Gonna track this in #85 instead |