Page MenuHomePhabricator

[keyserver/lib] Change frame image from hello world to channel image
ClosedPublic

Authored by will on Nov 20 2024, 8:45 PM.
Tags
None
Referenced Files
F3513964: D13985.id46272.diff
Sun, Dec 22, 2:48 AM
F3513941: D13985.id46278.diff
Sun, Dec 22, 2:39 AM
F3513836: D13985.id46250.diff
Sun, Dec 22, 2:26 AM
Unknown Object (File)
Fri, Dec 20, 10:49 PM
Unknown Object (File)
Fri, Dec 20, 10:20 PM
Unknown Object (File)
Fri, Dec 20, 7:49 PM
Unknown Object (File)
Thu, Dec 19, 4:28 AM
Unknown Object (File)
Thu, Dec 19, 1:24 AM
Subscribers

Details

Summary

Currently the frame image is just the text "Hello world". As part of the first changes to the image, we're replacing the background of the image
with the farcaster channel's cover image if it exists. If it doesn't, we use the default channel image

Depends on D13971

Test Plan

Tested in the warpcast frame validator. Confirmed that the frame image displayed was just the channel cover image

Diff Detail

Repository
rCOMM Comm
Branch
wyilio/frames
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

keyserver/src/frog/frog.js
43

This is a placeholder. I plan to include the default cover image in keyserver/images, statically serve it through the Frog Hono server, and use its URL here in future diffs

will requested review of this revision.Nov 20 2024, 9:03 PM
ashoat added inline comments.
keyserver/flow-typed/npm/frog_v0.18.x.js
41

Can it actually return either Promise<FrogResponse> or FrogResponse?

keyserver/src/frog/frog.js
33–39

This seems more readable

This revision is now accepted and ready to land.Nov 21 2024, 4:02 PM
will marked an inline comment as done.

feedback

keyserver/flow-typed/npm/frog_v0.18.x.js
41

This feedback appears to have been ignored

keyserver/flow-typed/npm/frog_v0.18.x.js
41

Frog specifies that you can have the callback be asynchronous:
A frame handler can also be asynchronous (ie. async (c) => { ... }).

You can do so by adding async in front of the callback function:
frogApp.frame('/', c => { ...
frogApp.frame('/', async c => { ...

From my understanding of flow, we only need to include the return type as Promise<> to specify the callback as async

keyserver/flow-typed/npm/frog_v0.18.x.js
41

Ah. Already wrote a comment but didn't hit submit

keyserver/flow-typed/npm/frog_v0.18.x.js
41

The first example is not returning Promise<FrogResponse>, it's returning FrogResponse

Seems like you should update the signature to be returning Promise<FrogResponse> | FrogResponse

fix frog callback return type to be Promise<FrogResponse> | FrogResponse

keyserver/flow-typed/npm/frog_v0.18.x.js
41

Including in next rebase