From b60f5b514918be9f61316778dcf4e6a43e7ca5b0 Mon Sep 17 00:00:00 2001 From: Natalie Bridgers Date: Wed, 30 Sep 2026 17:47:27 -0500 Subject: [PATCH] revert(atproto): remove validation as it blocks out older version teleports Signed-off-by: Natalie Bridgers --- pkg/atproto/sync.go | 8 ------- pkg/atproto/teleport_endstream.go | 35 ------------------------------- pkg/atproto/teleport_test.go | 19 ----------------- 3 files changed, 62 deletions(-) diff --git a/pkg/atproto/sync.go b/pkg/atproto/sync.go index 0c8baf139..f0381f39c 100644 --- a/pkg/atproto/sync.go +++ b/pkg/atproto/sync.go @@ -623,14 +623,6 @@ func (atsync *ATProtoSynchronizer) handleCreateUpdate(ctx context.Context, userD if r == nil { return nil } - sourceIsLive, err := atsync.teleportSourceIsLive(userDID, rec.Livestream) - if err != nil { - return fmt.Errorf("failed to validate teleport source stream: %w", err) - } - if !sourceIsLive { - log.Debug(ctx, "ignoring teleport without an active source stream owned by its author") - return nil - } startsAt, err := time.Parse(time.RFC3339, rec.StartsAt) if err != nil { log.Error(ctx, "failed to parse startsAt", "err", err) diff --git a/pkg/atproto/teleport_endstream.go b/pkg/atproto/teleport_endstream.go index 08a6a0d88..858c6d513 100644 --- a/pkg/atproto/teleport_endstream.go +++ b/pkg/atproto/teleport_endstream.go @@ -19,41 +19,6 @@ import ( comatproto "stream.place/streamplace/pkg/comatproto" ) -// teleportSourceIsLive confirms that a new teleport is authored by the owner -// of the source stream and references that owner's latest, unended stream. -func (atsync *ATProtoSynchronizer) teleportSourceIsLive( - repoDID string, - livestreamRef *comatproto.RepoStrongRef, -) (bool, error) { - if livestreamRef == nil || livestreamRef.Uri == "" || livestreamRef.Cid == "" { - return false, nil - } - - aturi, err := syntax.ParseATURI(livestreamRef.Uri) - if err != nil || - aturi.Authority().String() != repoDID || - aturi.Collection().String() != "place.stream.livestream" { - return false, nil - } - - livestream, err := atsync.Model.GetLatestLivestreamForRepo(repoDID) - if err != nil { - return false, fmt.Errorf("get source livestream: %w", err) - } - if livestream == nil || - livestream.URI != livestreamRef.Uri || - livestream.CID != livestreamRef.Cid || - livestream.Livestream == nil { - return false, nil - } - - var record placestream.Livestream - if err := glex.DecodeCBOR(*livestream.Livestream, &record); err != nil { - return false, fmt.Errorf("decode source livestream: %w", err) - } - return record.EndedAt == nil, nil -} - // endLivestreamForTeleport ends the source streamer's livestream when a teleport // fires — the same record update that place.stream.live.stopLivestream performs // (set endedAt on the place.stream.livestream record via a getRecord/putRecord diff --git a/pkg/atproto/teleport_test.go b/pkg/atproto/teleport_test.go index 952ca5950..820c2e88e 100644 --- a/pkg/atproto/teleport_test.go +++ b/pkg/atproto/teleport_test.go @@ -10,7 +10,6 @@ import ( "github.com/bluesky-social/indigo/atproto/syntax" "github.com/stretchr/testify/require" "stream.place/streamplace/pkg/bus" - "stream.place/streamplace/pkg/comatproto" "stream.place/streamplace/pkg/model" "stream.place/streamplace/pkg/placestream" "stream.place/streamplace/pkg/spid" @@ -37,20 +36,6 @@ func TestTeleportArrivalNotFromBackfill(t *testing.T) { Version: "3lrev00000000", })) - sourceStream := &placestream.Livestream{ - LexiconTypeID: "place.stream.livestream", - CreatedAt: time.Now().UTC().Format(time.RFC3339), - Title: "Source stream", - } - var sourceStreamBuffer bytes.Buffer - require.NoError(t, sourceStream.MarshalCBOR(&sourceStreamBuffer)) - sourceStreamCBOR := sourceStreamBuffer.Bytes() - sourceStreamCID, err := spid.GetCID(sourceStream) - require.NoError(t, err) - sourceStreamURI := "at://" + traveller + "/place.stream.livestream/3lsourcestream" - require.NoError(t, atsync.handleCreateUpdate(ctx, traveller, syntax.RecordKey("3lsourcestream"), - &sourceStreamCBOR, sourceStreamCID.String(), syntax.NSID("place.stream.livestream"), false, false, "")) - // Watch the streamer's topic, which is where an arrival is announced. ch := b.Subscribe(streamer) defer b.Unsubscribe(streamer, ch) @@ -77,10 +62,6 @@ func TestTeleportArrivalNotFromBackfill(t *testing.T) { Streamer: streamer, StartsAt: startsAt, DurationSeconds: &duration, - Livestream: &comatproto.RepoStrongRef{ - Uri: sourceStreamURI, - Cid: sourceStreamCID.String(), - }, } var buf bytes.Buffer require.NoError(t, rec.MarshalCBOR(&buf)) -- 2.51.2