Page MenuHomePhabricator

[lib] add new cache for fc channel info
ClosedPublic

Authored by varun on Oct 17 2024, 5:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 7:58 AM
Unknown Object (File)
Fri, Nov 22, 1:20 AM
Unknown Object (File)
Fri, Nov 22, 1:07 AM
Unknown Object (File)
Fri, Nov 22, 1:06 AM
Unknown Object (File)
Thu, Nov 21, 7:39 PM
Unknown Object (File)
Wed, Nov 20, 1:05 PM
Unknown Object (File)
Wed, Nov 20, 8:17 AM
Unknown Object (File)
Wed, Nov 20, 8:16 AM
Subscribers

Details

Summary

we will use this cache to fetch farcaster channel image URLs (and later, descriptions)

this is modeled after the fc cache for users

Test Plan

tested at end of stack, made sure that we're only calling neynar API once per channel ID

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

varun held this revision as a draft.
varun published this revision for review.Oct 17 2024, 8:52 PM
ashoat requested changes to this revision.Oct 20 2024, 11:19 AM
ashoat added inline comments.
lib/utils/fc-cache.js
183

You're diverging from the approach of getFarcasterUsersForFIDs, perhaps intentionally. But if you are returning in the case of a timeout, then the ternary expression on line 186 doesn't make sense.

If you want to cache failed query results (eg. as a result of a timeout) then I think you'll need to change this line. If you don't want to cache them, then I think you can just use cacheTimeout in all cases.

This revision now requires changes to proceed.Oct 20 2024, 11:19 AM
This revision is now accepted and ready to land.Oct 22 2024, 1:29 PM
This revision was automatically updated to reflect the committed changes.