You are reading content from Scuttlebutt
@mix %jk11E8bZvgIRPzHzYGMeNntcH6fNtcfhe8eE0zJjQ84=.sha256

Help wanted | gatherings madness

I'm seeing this super weird bug around this gathering: %r8Ol0jr... , namely, it's not rendering.

The problem is this code in patchbay-gatherings plugs/message/html/render/gathering.js :

 3: const { isGathering } = require('ssb-gathering-schema')

// ...

20:    if (!isGathering(msg)) return   // <<<<<

is it a gathering? isGathering in the current master branch of patchbay say NO.

logging isGathering.errors I discover it's beef is with the mentions on this gathering message (a new feature, this gathering was made by scry). Specifically it seems the mentions are ok but this validator realy doesn't like the name attribute on those mentions. Take it out and this thing is all like YEP, that's a gathering.

Here's the head spin

npm link a local copy of patchbay-gatherings and it fucking works fine.
I'm pulling my hair out.
It seems like somehow different code is being installed or run... but I don't know where and haven't been able to find it.

I'm really hoping it's me doing something stupid.
I'll buy anyone who can throw me a rope to pull myself out of this pit I'm in a beer

cc @christianbundy can I ask you for help? I feel like you're a master sleuth. (I have tabs open for your PRs, the next one I'm going to get merged is the markdown one... I haven't forgotten the things <3)

User has not chosen to be hosted publicly
User has not chosen to be hosted publicly
@Christian Bundy %YYOuBj53d1yibB3VBdNKsZNdHqdGOQVxFzaM5pjEOP0=.sha256

@mix Hey, I'm happy to help!

Like @अभिनाश mentioned, this seems to be an issue where everything works great with 2.12.x but breaks with 2.13.x. The reason npm link patchbay-gatherings is working fine is the patchbay-gatherings dependency tree looks like this:

$ npm ls ssb-ref
patchbay-gatherings@3.2.3 /home/christianbundy/src/ssbc/patchbay-gatherings
├─┬ scuttle-gathering@1.3.2
│ ├── ssb-ref@2.12.0 
│ └─┬ ssb-sort@1.1.0
│   └── ssb-ref@2.12.0  deduped
└─┬ ssb-gathering-schema@1.2.1
  ├── ssb-ref@2.12.0  deduped
  └─┬ ssb-schema-definitions@1.1.0
    └── ssb-ref@2.12.0

When you use npm link, it copies the entire directory including node_modules, so patchbay-gatherings is still using ssb-ref@2.12.0, which fixes the issue. We can reproduce the issue in our local patchbay-gatherings by running:

npm install --save-dev ssb-ref@2.13.4

So the new dependency tree, with or without npm link, becomes:

$ npm ls ssb-ref
patchbay-gatherings@3.2.3 /home/christianbundy/src/ssbc/patchbay-gatherings
├─┬ scuttle-gathering@1.3.2
│ ├── ssb-ref@2.13.4  deduped
│ └─┬ ssb-sort@1.1.0
│   └── ssb-ref@2.13.4  deduped
├─┬ ssb-gathering-schema@1.2.1
│ ├── ssb-ref@2.13.4  deduped
│ └─┬ ssb-schema-definitions@1.1.0
│   └── ssb-ref@2.13.4  deduped
└── ssb-ref@2.13.4

Not sure what the issue with ssb-ref is, but if I have some time later today I can pick at it a bit more. Hope this helps!

@mix %rDaBLNnwqBQB24nMthOLVLJ9x/M75p2YUS2QHG17tIs=.sha256

this is awesome to wake up to, thank you both for your investigation.

ok I've sunk another hour into this and made no great inroads D:
What I've tried:

  • pinned ssb-ref @ ~12.2.0 (so minor range is pinned)
    • ssb-schema-defintions, ssb-gathering-schema, scuttle-gathering, patchbay-gatherings all fixed
    • installing newest updated
    • here's some of the results of npm ls ssb-ref in patchbay:
patchbay@7.15.1 /home/mix/projects/SSBC/patchbay
─┬ patch-inbox@1.2.0
│ └── ssb-ref@2.13.4  deduped
...
├─┬ patchbay-gatherings@3.2.5
│ ├─┬ scuttle-gathering@1.3.3
│ │ └── ssb-ref@2.12.2 
│ └─┬ ssb-gathering-schema@1.2.2
│   ├── ssb-ref@2.12.2 
│   └─┬ ssb-schema-definitions@1.1.1
│     └── ssb-ref@2.12.2 
...

I can confirm that npm linking patchbay-gatherings in does still work. So... I'm guessing ssb-ref seems not to be the culprit? because everything related to gatherings has the older version of ssb-ref (I checked by looking in node_modules to be absolutely sure) (Is something going horridlbly wrong with node / npm... surely not?)

@mix %QRH1wYz8u0avWFvZ3ittDDBnzBS7mNk9xy/xYonExbQ=.sha256

Further:

can confirm that installing ssb-ref@latest in linked patchbay-gatherhings breaks things.
MOST INTERESTINGLY, if I uninstall ssb-ref from that repo, then the package-lock.json and install is still in a 'polluted' state and things remain broken.

I've pushed this broken package-lock.json up in the branch polluted_packagelock of patchbay-gatherings.
To toggle between states all you need to do is:

  1. have patchbay-gatherings linked in
  2. checkout the patchbay-gatherings branch you want to test master or polluted_packagelock
  3. run npm install in that repo
  4. reload patchbay with ctrl+r
    • you don't need to close and open it again for the broken / working state to change for this one...

cc @Avinash @Christian Bundy

@Christian Bundy %S+8WkcA60F78uWQoR6MRyS3uVoycn634037i3Ea72e8=.sha256

@mix

Possible aside: I've pulled ssb-gathering-schema and tried to run npm test, but it looks like it's failing two tests -- could that be where the problem is, or have those tests always failed?

@mix %eAVNGVpuCvYxK0EL5StUL0k1cOC2nF/fXSAByyudbzI=.sha256

I think we got it. @christianbundy and I had a call and we think ssb-ref@2.12.0 works.

We suspect 2.12.2 is a bad ssb-ref

Aim to get things working then loop back on this apparent culprit

@Dominic %Ov6OjwSg+zKf5FED2YH+PQYcMsN6jbRA9uQ0m3kYN5s=.sha256

ssb-ref@2.12.2 is where canonical base64 was added. if that broke something we need a testcase!

@mix %xMOR58LM+2WIMzm+uaDGfQpLjMpEhY8gqpWilESqbVU=.sha256

I've stabilised gatherings in patchbay and moving in to add (failing) tests to ssb-ref!

@dan %4BejGB45zMoNvPMIHvgLRnisdkFcvH4tA3km83im+Fc=.sha256

hmmmm.

not sure if this is related. apparently I now have no friends.

no-friends.png

I was running latest master f456ab9 I then was having the same issue which mix pointed out, so I then rolled back to 4ef413f. That is when I noticed having no friends.

I then went back to master f456ab9 but am having the same thing happen.

Each time I would do the following:

git checkout `<commit-ref>`
rm -rf node_modules
npm install
npm run rebuild
npm start

Is this connected?

cc: @mix @dominic @Christian Bundy

@dan %EwuU6gauYPruaBEHj1M9RMWGbV2GB8l0VfsBRPYvaiI=.sha256

If someone could like or quote my response - I am wondering if I have somehoe forked or otherwise borked my feed....

@mix %9QSyQIeAgLScayhm6RAmtEQeP8nZKNyhsND38BXJUN0=.sha256

I can see you @dan hassan. I'm going to look at that problem later

@dominic you cut some of the API on ssb-ref. I was using those regex. I'm going to open a PR and merge it adding those back in.

@Christian Bundy %uNwDxhkYAAp3dniF1do0vU9Y8rNo+Bxd5noQYN9L6qo=.sha256

@dan I see you too, I've had that happen before. Not sure what causes it, but I think closing out of the profile and re-opening it resolves the issue.

@Christian Bundy %oI3ocSYelLX+tYnz+yWCVRf2HTRvs3WA5OwPY0wg228=.sha256

@dan Sorry, I didn't pay enough attention to your post the first time I read it. My above message should say "when it happens to me, closing out of the profile and re-opening it resolves the issue".

@mix %elotwAgrKmPXKcacvoLmpaBSJ+Lwt4/QpiOot5yPLBA=.sha256

ok got it ... happily (?) it was as mundane and Dominic killing an export that I was using.
Have added a little catcher in ssb-schema-defintions which will stop this sort of break again.

Other interesting #ssb-learning :

  • update just one module in your tree like npm update ssb-ref --depth 5
  • check you hit it all with npm ls ssb-ref | less and then search vim-style for your naughty broken versions

I updated patchbays tree for ssb-ref and ssb-schema-defintions so this bug should not occur anywhere in patchbay right now. The patches are all in the semver patch range so new installs of existing modules should automatically get the nice versions.


@matt if you are depending on ssb-ref for any regex exports or schemas this it a hole.

@mix %cBkBzflso3U+lUUAaqd3ONTe2TTDQIYWGyozr91YsEo=.sha256

@dan hassan I can't reproduce your bug. Try pulling and seeing it if it's an issue still.

If it is, please start another thread for that

@dan %oHlblQsOLNZgeIQBKkQhoN65t7kly/tcoFwztn2prag=.sha256

@christianbundy "My above message should say "when it happens to me, closing out of the profile and re-opening it resolves the issue"."

that did not fix it

@mix "Try pulling and seeing it if it's an issue still."

That fixed it :)

Join Scuttlebutt now