A container registry that uses the AT Protocol for manifest storage and S3 for blob storage. atcr.io
docker container atproto go

fix bluesky profile not emitting firehose event

evan.jarrett.net 3085fc72 cecf6d4b

verified
+20 -15
+20 -15
pkg/hold/server.go
··· 123 123 return nil, fmt.Errorf("failed to create S3 service: %w", err) 124 124 } 125 125 126 - // Bootstrap PDS with captain record, hold owner as first crew member, and profile 126 + // Bootstrap events from existing repo records (one-time migration). 127 + // Must run BEFORE the live event handler is wired, so it captures 128 + // the full historical state without interference from new writes. 129 + if err := s.broadcaster.BootstrapFromRepo(s.PDS); err != nil { 130 + slog.Warn("Failed to bootstrap events from repo", "error", err) 131 + } 132 + 133 + // Backfill records index from existing MST data (one-time on startup) 134 + if err := s.PDS.BackfillRecordsIndex(ctx); err != nil { 135 + slog.Warn("Failed to backfill records index", "error", err) 136 + } 137 + 138 + // Wire up repo event handler with records indexing + broadcaster. 139 + // Must be BEFORE Bootstrap so that record creates/updates during 140 + // bootstrap (captain, crew, profile) emit to the firehose. 141 + indexingHandler := s.PDS.CreateRecordsIndexEventHandler(s.broadcaster.SetRepoEventHandler()) 142 + s.PDS.RepomgrRef().SetEventHandler(indexingHandler, true) 143 + 144 + // Bootstrap PDS with captain record, hold owner as first crew member, and profile. 145 + // Now that the event handler is wired, any changes here emit to the firehose. 127 146 if err := s.PDS.Bootstrap(ctx, s3Service, pds.BootstrapConfig{ 128 147 OwnerDID: cfg.Registration.OwnerDID, 129 148 Public: cfg.Server.Public, ··· 147 166 } 148 167 } 149 168 } 150 - 151 - // Bootstrap events from existing repo records (one-time migration) 152 - if err := s.broadcaster.BootstrapFromRepo(s.PDS); err != nil { 153 - slog.Warn("Failed to bootstrap events from repo", "error", err) 154 - } 155 - 156 - // Backfill records index from existing MST data (one-time on startup) 157 - if err := s.PDS.BackfillRecordsIndex(ctx); err != nil { 158 - slog.Warn("Failed to backfill records index", "error", err) 159 - } 160 - 161 - // Wire up repo event handler with records indexing + broadcaster 162 - indexingHandler := s.PDS.CreateRecordsIndexEventHandler(s.broadcaster.SetRepoEventHandler()) 163 - s.PDS.RepomgrRef().SetEventHandler(indexingHandler, true) 164 169 165 170 slog.Info("Embedded PDS initialized successfully with firehose and records index enabled") 166 171 } else {