File tree Expand file tree Collapse file tree
server/utils/atproto/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,14 +45,14 @@ export class ProfileUtils {
4545 * @returns
4646 */
4747 async getProfile ( handle : string ) : Promise < NPMXProfile | undefined > {
48- const profileKey = CACHE_PROFILE_KEY ( handle )
48+ const miniDoc = await this . slingshotMiniDoc ( handle )
49+ const profileKey = CACHE_PROFILE_KEY ( miniDoc . did )
4950 const cachedProfile = await this . cache . get < NPMXProfile > ( profileKey )
5051
5152 let profile : NPMXProfile | undefined
5253 if ( cachedProfile ) {
5354 profile = cachedProfile
5455 } else {
55- const miniDoc = await this . slingshotMiniDoc ( handle )
5656 const profileUri = `at://${ miniDoc . did } /dev.npmx.actor.profile/self`
5757 const response = await fetch (
5858 `https://${ SLINGSHOT_HOST } /xrpc/blue.microcosm.repo.getRecordByUri?at_uri=${ profileUri } ` ,
@@ -72,7 +72,7 @@ export class ProfileUtils {
7272
7373 async updateProfileCache ( handle : string , profile : NPMXProfile ) : Promise < NPMXProfile | undefined > {
7474 const miniDoc = await this . slingshotMiniDoc ( handle )
75- const profileKey = CACHE_PROFILE_KEY ( miniDoc . handle )
75+ const profileKey = CACHE_PROFILE_KEY ( miniDoc . did )
7676 await this . cache . set ( profileKey , profile , CACHE_MAX_AGE )
7777 return profile
7878 }
You can’t perform that action at this time.
0 commit comments