It's got some bugs, but I've finally got a super simple #same-as implementation working in the existing clients (as a plugin for ssb-server).
We're getting closer...
It's got some bugs, but I've finally got a super simple #same-as implementation working in the existing clients (as a plugin for ssb-server).
We're getting closer...
Found a bug! Apparently this message forked my feed six days ago (!) and it took until tonight for me to notice and fix.
Hey everyone, happy to be back. 👋
I thought that we couldn't recover from forks?
hi @David Wales
you can't recover from a fork if it causes a network partition, where one set of peers think your latest message is beep and another set of peers think your latest message is boop. if you continue publishing messages under the boop fork, those on the beep fork won't accept those new messages because they appear as invalid.
you can recover from a fork if everybody except you thinks your forked message is invalid. for example, when you migrate your identity to a new device, if you publish a message before you are sync'd, this will cause a fork, however everyone else already has your feed and knows that the forked message is invalid, so they will ignore the fork, which means when you delete your feed and re-sync, you can publish a valid message again.
hope that makes sense
In case it becomes useful, I want to share the code I used to recover from the fork.
I looked at my profile on viewer.scuttlebot.io and found the ID of my last known message, which I then read:
ssb-server get %CRxZR8PmT+etS6c0osbfQPv1/ZcrbTKQzezeSR43sns=.sha256
This returned some JSON which gave my the timestamp of my last known message.
{
"previous": "%5bx3E5HOVZxFUxuhjKMFsby2N263oZNQlKFwduW0CME=.sha256",
"sequence": 9277,
"author": "@+oaWWDs8g73EZFUMfW37R/ULtFEjwKN/DczvdYihjbU=.ed25519",
"timestamp": 1553046768056,
"hash": "sha256",
"content": {
"text": "It's got some bugs, but I've finally got a super simple #same-as implementation working in the existing clients (as a plugin for ssb-server).\n\nWe're getting closer...",
"type": "post",
"mentions": []
},
"signature": "iaXrPg9kG+Q84W2BRpBZ3A/jROMAMXfp3iitFBBlUFi/y/9Z4mWWP/oXcf2eE9IMgjUaYUCdFv+miRVqEMjQDA==.sig.ed25519"
}
Since my other messages still had reasonable timestamps, I just needed to gather all of my messages with a timestamp greater than 1553046768056
and save them to a file:
ssb-server createHistoryStream --id @+oaWWDs8g73EZFUMfW37R/ULtFEjwKN/DczvdYihjbU=.ed25519 --private \
| jq -c 'select(.timestamp > 1552497153800) | .value.content' \
>! from-forked.json.lines
I opened the file and made sure everything looked right, then:
tar -cz ~/.ssb/flume -f ~/.ssb/flume-broken.tar.gz
rm -rf ~/.ssb/flume
cd ~/.ssb/ && tar -xvf flume.tar.gz
< from-forked.json.lines \
| while read -r line; \
<<< "$line" \
| sbot publish . && do <<< "$line" \
>>! ./done.json.lines; \
sleep 1; \
done