-
Notifications
You must be signed in to change notification settings - Fork 1
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
Test adding someone back into the group #111
Conversation
No dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No new dependency issues detected in pull request Bot CommandsTo ignore an alert, reply with a comment starting with Pull request alert summary
|
index.js
Outdated
@@ -503,6 +510,7 @@ module.exports = { | |||
pull.drain( | |||
(msg) => { | |||
const groupId = msg.value.content.recps[0] | |||
// TODO: also check if it's in one of the epoch tips |
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.
hmm there might be edge cases with this like if the new epoch is more than 1 epoch in the future and replication is slow, and how exactly getTipEpochs acts in that case. but that's definitely a bug we can fix in the future, and the worst that happens is the user gets removed from the group on the clientside
didn't get to this today sorry |
a lot of flakes in ci but seems to work fine locally |
pull.drain( | ||
(groupId) => myGroups.add(groupId), | ||
(groupInfo) => | ||
groupInfo.readKeys | ||
.map((readKey) => readKey.key.toString('base64')) | ||
.forEach((readKeyString) => myReadKeys.add(readKeyString)), |
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 works, but you could do it will pull-streams tidily too
pull.flatten()
pull.map(readKey => readKey.gey.toString('base64')),
pull.drain(
myReadKeys.add,
err => ...
)
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.
just seems slightly more complex?
@@ -80,6 +80,7 @@ | |||
"test:only": "if grep -r --exclude-dir=node_modules --exclude-dir=.git --color 'test\\.only' ; then exit 1; fi", | |||
"test:bail": "npm run test:raw | tap-arc --bail", | |||
"test": "npm run test:raw | tap-arc && npm run test:only", | |||
"lint": "eslint .", |
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.
Good, I've been missing this - I caught an "unused var" the other day, or maybe undefined var.
Anyway, I think this should be part of npm test
script
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.
my editor's been running it automatically on save but realized we didn't have an official way of doing it
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.
added to npm test
test/add-member.test.js
Outdated
name: 'bobrestart', | ||
keys: ssbKeys.generate(null, 'bob'), | ||
mfSeed: Buffer.from( | ||
'0000000000000000000000000000000000000000000000000000000000000b0b', | ||
'hex' | ||
), |
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.
extract as bobConfig
name: 'bobrestart', | |
keys: ssbKeys.generate(null, 'bob'), | |
mfSeed: Buffer.from( | |
'0000000000000000000000000000000000000000000000000000000000000b0b', | |
'hex' | |
), | |
...bobConfig |
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.
done
test/add-member.test.js
Outdated
await p(alice.close)(true) | ||
await p(bob.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.
await p(alice.close)(true) | |
await p(bob.close)(true) | |
await Promise.all([p(alice.close)(true), p(bob.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.
done
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.
couple of comments. Feel free to ignore or integrate
oh... tests failing ("cancelled after 10m") seems like it might be that same "getting stuck" on that |
Fixes #89
Based on #106