mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-28 00:12:25 +00:00
buildShareUrlFromEventId encoded a BARE event id: no author, no relay hints. A viewer whose relay set did not happen to carry that event could not resolve it, so bitvid fell back to the home feed -- the "the shared link just opens bitvid.network" report. It is not a rare edge case. The reported video was present on nos.lol but absent from relay.damus.io, relay.snort.social and relay.primal.net -- three of bitvid's four bootstrap relays -- so most viewers arriving cold could not open it at all. The pointer now carries: - the video's author, pulled from videosMap, which also lets clients look the event up by author+kind if the id itself has aged out of a relay - up to three relay hints from the client's write relays (falling back to its general relay list), deduped and scheme-filtered Both are best-effort: an unknown video or a malformed pubkey still produces the old bare-id pointer rather than an invalid one, and no relays configured omits the hint instead of encoding an empty array. Also restores the path separator. The base URL has its trailing slash stripped, so shared links read `https://bitvid.network?v=...`. That is legal and browsers normalize it, but it looks like a typo in a note and some link parsers mis-detect where the URL ends. New tests fail 6/9 without the change. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>