ssbc / ssb-tribes2-demo

A simple electron app demonstrating the features of ssb-tribes2
Other
2 stars 0 forks source link

Error when opening group when you're the 3rd member #5

Closed Powersource closed 1 year ago

Powersource commented 1 year ago

I init alice bob carol, connect them in that order (i.e. not alice and carol). Carol doesn't manage to list members, and also gets this error (not crashing) every time she tries to render the group.

/home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/pull-flat-merge@2.0.3/node_modules/pull-flat-merge/index.js:16 Uncaught Error: failed to get initial preferred epoch
    at /home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/ssb-tribes2@1.3.0_async-append-only-log@4.3.10/node_modules/ssb-tribes2/lib/epochs.js:271:44
    at /home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/ssb-tribes2@1.3.0_async-append-only-log@4.3.10/node_modules/ssb-tribes2/lib/epochs.js:255:23
  Error: Failed to resolve epoch @tangle/reduce
    at /home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/ssb-tribes2@1.3.0_async-append-only-log@4.3.10/node_modules/ssb-tribes2/lib/epochs.js:255:26
    at /home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/ssb-tribes2@1.3.0_async-append-only-log@4.3.10/node_modules/ssb-tribes2/lib/epochs.js:374:25
  Error: Failure collecting epoch messages
    at /home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/ssb-tribes2@1.3.0_async-append-only-log@4.3.10/node_modules/ssb-tribes2/lib/epochs.js:374:28
  Error: Failed to collect epoch data
    at /home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/ssb-tribes2@1.3.0_async-append-only-log@4.3.10/node_modules/ssb-tribes2/lib/epochs.js:499:32
    at /home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/pull-stream@3.7.0/node_modules/pull-stream/sinks/reduce.js:10:5
  Error: Failed to get epoch author
    at /home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/ssb-tribes2@1.3.0_async-append-only-log@4.3.10/node_modules/ssb-tribes2/lib/epochs.js:492:27
    at /home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/ssb-meta-feeds@0.39.0/node_modules/ssb-meta-feeds/api.js:186:22
  Error: unable to find root feed id
    at /home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/ssb-meta-feeds@0.39.0/node_modules/ssb-meta-feeds/api.js:186:25
    at /home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/ssb-meta-feeds@0.39.0/node_modules/ssb-meta-feeds/query.js:77:18
    at /home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/pull-stream@3.7.0/node_modules/pull-stream/sinks/drain.js:26:24
    at /home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/pull-stream@3.7.0/node_modules/pull-stream/throughs/take.js:30:13
    at /home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/pull-stream@3.7.0/node_modules/pull-stream/throughs/filter.js:17:11
    at /home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/pull-stream@3.7.0/node_modules/pull-stream/throughs/flatten.js:35:20
    at /home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/pull-stream@3.7.0/node_modules/pull-stream/throughs/map.js:19:9
    at readable (/home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/jitdb@7.0.7_async-append-only-log@4.3.10/node_modules/jitdb/operators.js:444:7)
    at /home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/pull-stream@3.7.0/node_modules/pull-stream/throughs/map.js:11:7
    at nextStream (/home/me/prj/ssb/ssb-tribes2-demo/node_modules/.pnpm/pull-stream@3.7.0/node_modules/pull-stream/throughs/flatten.js:33:9)
Powersource commented 1 year ago

@mixmix here's a slightly different one

Powersource commented 1 year ago

I would've guessed that maybe carol doesn't manage to replicate alice, therefore doesn't see alice's additions of alice and bob, or something like that. But carol does see alice's messages posted in the group.

It does specifically fail at getting the group author. That getter looks like

    author(epochRoot, cb) {
      ssb.metafeeds.findRootFeedId(epochRoot.value.author, cb)
    },

hmm added some logging in isRootFeedId. it runs on carol's id when she opens a group of her own, and that works fine (detects that it's a rootId). but when opening alice's group it logs that alice's rootId is not actually a rootId :thinking:

Powersource commented 1 year ago

the member list is fixed if alice and carol connect (and follow) directly. hmm maybe it's something main feed related

Powersource commented 1 year ago

Things seem to work better if I make peers replicate the main feeds of group members like

diff --git a/src/bot.js b/src/bot.js
index 304ae40..517e97e 100644
--- a/src/bot.js
+++ b/src/bot.js
@@ -67,7 +67,11 @@ module.exports = function startSbot() {
       partialReplication: {
         0: [{}],
         1: [{ purpose: "main" }, { purpose: "group/additions" }],
-        group: [{ purpose: "$groupSecret" }, { purpose: "group/additions" }],
+        group: [
+          { purpose: "main" },
+          { purpose: "$groupSecret" },
+          { purpose: "group/additions" },
+        ],
       },
     },
   });