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
F3508537: D13985.id46272.diff
Fri, Dec 20, 10:49 PM
F3508469: D13985.id46278.diff
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
Unknown Object (File)
Wed, Dec 18, 11:35 AM
Unknown Object (File)
Sun, Dec 15, 12:27 AM
Unknown Object (File)
Sun, Dec 15, 12:20 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

keyserver/src/frog/frog.js
43 ↗(On Diff #45915)

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 ↗(On Diff #45915)

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

keyserver/src/frog/frog.js
33–39 ↗(On Diff #45915)

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 ↗(On Diff #45915)

This feedback appears to have been ignored

keyserver/flow-typed/npm/frog_v0.18.x.js
41 ↗(On Diff #45915)

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 ↗(On Diff #45915)

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

keyserver/flow-typed/npm/frog_v0.18.x.js
41 ↗(On Diff #45915)

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 ↗(On Diff #45915)

Including in next rebase