A decentralized music tracking and discovery platform built on AT Protocol 🎵 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz
98
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: enhance user profile updates by publishing changes to the user context

+30
+30
apps/api/src/xrpc/app/rocksky/actor/getProfile.ts
··· 267 267 .where(eq(tables.users.did, profile.did)) 268 268 .execute(); 269 269 profile.user = users[0]; 270 + profile.ctx.nc.publish( 271 + "rocksky.user", 272 + Buffer.from( 273 + JSON.stringify({ 274 + xata_id: profile.user.id, 275 + did: profile.user.did, 276 + handle: profile.user.handle, 277 + display_name: profile.user.displayName, 278 + avatar: profile.user.avatar, 279 + xata_createdat: profile.user.createdAt.toISOString(), 280 + xata_updatedat: profile.user.updatedAt.toISOString(), 281 + xata_version: 1, 282 + }) 283 + ) 284 + ); 270 285 } else { 271 286 // Update existing user in background if handle or avatar or displayName changed 272 287 if ( ··· 286 301 }) 287 302 .where(eq(tables.users.id, profile.user.id)) 288 303 .execute(); 304 + profile.ctx.nc.publish( 305 + "rocksky.user", 306 + Buffer.from( 307 + JSON.stringify({ 308 + xata_id: profile.user.id, 309 + did: profile.user.did, 310 + handle, 311 + display_name: _.get(profile, "profileRecord.value.displayName"), 312 + avatar: `https://cdn.bsky.app/img/avatar/plain/${profile.did}/${_.get(profile, "profileRecord.value.avatar.ref", "").toString()}@jpeg`, 313 + xata_createdat: profile.user.createdAt.toISOString(), 314 + xata_updatedat: new Date().toISOString(), 315 + xata_version: (profile.user.xataVersion || 1) + 1, 316 + }) 317 + ) 318 + ); 289 319 } 290 320 } 291 321