You are reading content from Scuttlebutt
@Christian Bundy %CRxZR8PmT+etS6c0osbfQPv1/ZcrbTKQzezeSR43sns=.sha256

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...

@Christian Bundy %6yau0/XR1fRra+F7JJ4MFbIRpwUYqO7aDpf+tH9G4lc=.sha256

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. 👋

User has not chosen to be hosted publicly
@mikey %OpPLYwSw1H9wiHFd2pUO1Tc0FGoZ6YFfRDjg5mEjyV8=.sha256

I thought that we couldn't recover from forks?

hi @David Wales :smiley_cat:

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 :fork_and_knife:

User has not chosen to be hosted publicly
@kas %lMiXyTKVvHDMilhkOOD856KfvJ/8TIo/haKpKuVAGHA=.sha256
Voted Found a bug! Apparently this message forked my feed six days ago (!) and it
User has chosen not to be hosted publicly
@Christian Bundy %WIiCLuPpqFptpI5Sord0EhmHnAwz/Wah2L+7lzt75Jg=.sha256

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:

  1. Made a flume database backup: tar -cz ~/.ssb/flume -f ~/.ssb/flume-broken.tar.gz
  2. Deleted my flume directory: rm -rf ~/.ssb/flume
  3. Restored from an earlier backup: cd ~/.ssb/ && tar -xvf flume.tar.gz
  4. Waited for my messages to sync up.
  5. Re-published my messages!
< from-forked.json.lines \
| while read -r line; \
  <<< "$line" \
  | sbot publish . && do <<< "$line" \
  >>! ./done.json.lines; \
  sleep 1; \
done
@Matt Lorentz (desktop) %YoXTkjru4QOV/taHSLJiKD5iouMxh5D4hiB0g/yhWAw=.sha256
Voted It's got some bugs, but I've finally got a super simple #same-as implementa
@Anders %OSric6287ywsvBQgS9LtZsdn3edVgG48dGnJAX5n6wQ=.sha256
Voted It's got some bugs, but I've finally got a super simple #same-as implementa
@Anders %r6Ku91OwDZNXkmO0T573ERVUAGGF7mHQ8eLqmGTbqec=.sha256
Voted In case it becomes useful, I want to share the code I used to recover from
Join Scuttlebutt now