File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -149,11 +149,17 @@ export class PackageLikesUtils {
149149 const subjectRef = PACKAGE_SUBJECT_REF ( packageName )
150150
151151 const splitAtUri = atUri . replace ( 'at://' , '' ) . split ( '/' )
152- const backLink = {
152+ const collection = splitAtUri [ 1 ]
153+ const rkey = splitAtUri [ 2 ]
154+
155+ if ( ! collection || ! rkey ) {
156+ throw new Error ( `Invalid atUri given: ${ atUri } ` )
157+ }
158+ const backLink : Backlink = {
153159 did : usersDid ,
154- collection : splitAtUri [ 1 ] ,
155- rkey : splitAtUri [ 2 ] ,
156- } as Backlink
160+ collection,
161+ rkey,
162+ }
157163
158164 // We store the backlink incase a user is liking and unlikign rapidly. constellation takes a few seconds to capture the backlink
159165 const usersBackLinkKey = CACHE_USERS_BACK_LINK ( packageName , usersDid )
Original file line number Diff line number Diff line change @@ -10,5 +10,5 @@ export function getCacheAdatper(prefix: string): CacheAdapter {
1010 } )
1111 return new RedisCacheAdatper ( redis , prefix )
1212 }
13- return new StorageCacheAdapter ( )
13+ return new LocalCacheAdapter ( )
1414}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ function isCacheEntryStale(entry: LocalCachedEntry): boolean {
2222/**
2323 * Local implmentation of a cache to be used during development
2424 */
25- export class StorageCacheAdapter implements CacheAdapter {
25+ export class LocalCacheAdapter implements CacheAdapter {
2626 private readonly storage = useStorage ( 'generic-cache' )
2727
2828 async get < T > ( key : string ) : Promise < T | undefined > {
You can’t perform that action at this time.
0 commit comments