snarfed / bridgy-fed

🌉 A bridge between decentralized social network protocols
https://fed.brid.gy
Creative Commons Zero v1.0 Universal
634 stars 31 forks source link

Bluesky => AP: Expire and refresh DID docs #1201

Open ShreyanJain9 opened 3 months ago

ShreyanJain9 commented 3 months ago

When bridging a Bluesky post including an image to AP, Bridgy uses the blob url from my old PDS, which doesn't have it and can't serve it.

Bridgy is probably just not aware that my PDS migration ever happened, since there's not really an obvious sign of it to a service just consuming the Relay firehose and bridging the content to AP. Maybe this is something Bridgy should keep track of for bridged accounts, or it could use links to the AppView CDN instead of linking directly to the PDS blobs. I prefer the PDS approach, but using the CDN might be a much easier fix.

snarfed commented 3 months ago

Yup, your instincts are spot on, we just need to refresh our locally stored DID docs regularly. Should be straightforward!

snarfed commented 3 months ago

OK @ShreyanJain9 I've manually refreshed your DID doc. Mind trying again? If blobs work now, that confirms this hypothesis.

ShreyanJain9 commented 3 months ago

They work exactly as expected now! Thank you 🫡

Tamschi commented 2 days ago

@snarfed This should be solved already, right? As long as Bridgy Fed also reacts to DID doc updates it sees for users who are bridged at the time, I mean.

snarfed commented 2 days ago

Sadly it's not really solved afaik. Bridgy Fed would need to subscribe to the PLC directory's audit log, https://github.com/did-method-plc/did-method-plc#audit-logs , which it doesn't yet do. Afaik there isn't a websocket stream there yet, so we'd need to poll. (Confirmed.)

Alternatively, the PDS might emit #account events for DID doc changes - see #1119 - but I suspect not. Those aren't officially documented yet anyway. 😕