ckolderup / postmarks

a single-user bookmarking website designed to live on the Fediverse
https://postmarks.glitch.me
MIT License
459 stars 38 forks source link

Inbound Unfollow results in crash #71

Closed andypiper closed 10 months ago

andypiper commented 10 months ago

Running latest Git version on Glitch.

I enabled logging via LOGGING_ENABLED=true.

I'm seeing that if I attempt to send an unfollow request from my Mastodon account @andypiper@macaw.social to @andypiper@pipesmarks.glitch.me, the Glitch app crashes with this logged:

[2023-9-9 14:53:43] POST:/api/inbox 200 0.002ms
file:///app/src/routes/activitypub/inbox.js:75
  const name = req.body.object.replace(`https://${domain}/u/`, "");
                               ^
TypeError: req.body.object.replace is not a function
at handleUnfollow (file:///app/src/routes/activitypub/inbox.js:75:32)
at file:///app/src/routes/activitypub/inbox.js:254:18
    at Layer.handle [as handle_request] (/rbd/pnpm-volume/2c58c3bc-c846-4d1a-af35-475ee568b9ca/node_modules/express/lib/router/layer.js:95:5)
    at next (/rbd/pnpm-volume/2c58c3bc-c846-4d1a-af35-475ee568b9ca/node_modules/express/lib/router/route.js:144:13)
    at Route.dispatch (/rbd/pnpm-volume/2c58c3bc-c846-4d1a-af35-475ee568b9ca/node_modules/express/lib/router/route.js:114:3)
    at Layer.handle [as handle_request] (/rbd/pnpm-volume/2c58c3bc-c846-4d1a-af35-475ee568b9ca/node_modules/express/lib/router/layer.js:95:5)
    at /rbd/pnpm-volume/2c58c3bc-c846-4d1a-af35-475ee568b9ca/node_modules/express/lib/router/index.js:284:15
    at Function.process_params (/rbd/pnpm-volume/2c58c3bc-c846-4d1a-af35-475ee568b9ca/node_modules/express/lib/router/index.js:346:12)
    at next (/rbd/pnpm-volume/2c58c3bc-c846-4d1a-af35-475ee568b9ca/node_modules/express/lib/router/index.js:280:10)
    at Function.handle (/rbd/pnpm-volume/2c58c3bc-c846-4d1a-af35-475ee568b9ca/node_modules/express/lib/router/index.js:175:3)