0xStation / proposer

1 stars 0 forks source link

Add Scheduled Actions #816

Closed ilikesymmetry closed 1 year ago

ilikesymmetry commented 1 year ago

šŸ“¼ Feature demo

Note that you can demo this app on the preview URL, but the finest granularity we get for free is refreshes every 5 minutes!

What's included in this pr + description

Schedule parameters:

Motivation & Context

Steps to test

šŸ“¼ Local set up guide

create

  1. Create schedule -> see new check created and new schedule created in respective tabs
  2. Wait for next refresh at time to come and then see new schedule!
  3. Wait for counter to reach max count and then refreshing stops

edit

  1. Create schedule
  2. Changing schedule period doesn't change next refresh if we have not started yet
  3. Change schedule period (change one or both of coefficient or unit in "repeats every" question) -> next refresh time is new period applied to last refresh time

Screenshots and/or loom video

image image image

Logs showing retry attempts by Upstash in case of failure or running out of time from Vercel killing process, 4 retries are made before giving up

image image image image

Outstanding issues

Relevant docs

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ā†—ļøŽ

Name Status Preview Comments Updated
web āœ… Ready (Inspect) Visit Preview šŸ’¬ Add your feedback Feb 7, 2023 at 5:54PM (UTC)
kristencheung commented 1 year ago

I have ngrok running locally and looks like it's pinging the api, but for some reason though it's not creating a check.

I have it running per minute, the first check is created, but the subsequent checks aren't created, the progress counter isn't incremented, and the schedule isn't refreshed šŸ¤”

image

Trying to explore if something went wrong with the setup / gonna try digging into the code to see why it's not working properly..

Edit: okay following up, I spent too long to then figure out I didn't watch the end of the loom to know that I also needed to add the qstash env variables šŸ™ˆ

mcgingras commented 1 year ago

progress is 2/3 despite all three having been scheduled?

Screenshot 2023-01-27 at 12 50 40 PM

queued 4 despite only being out of 3

Screenshot 2023-01-27 at 12 51 44 PM
kristencheung commented 1 year ago

edge case, but if multiple schedules are synced looks like there can be some nonce collisions

image
mcgingras commented 1 year ago

pushing a commit to remove unused imports

kristencheung commented 1 year ago

Yayyy! nice job setting this up šŸ‘ left a couple of comments, and avoided ux comments since we're going to be moving to a new repo with new designs anyways.

should we not create a check right now if they set start date into the future / only create check if start is right now?

Yes^ that's the expected behavior

logic of editing a schedule while in the middle of its execution is a bit wonky

Worked for me! are there any known edge cases that are outstanding?

thinking we want to disable editing a schedule that has already completed because edit logic gets harder to set next refresh time Agree, we should disable editing after schedule is expired and allow users to archive expired schedules

kristencheung commented 1 year ago

pushing a commit to remove unused imports

reminder to add eslint-plugin-unused-imports to our next repo haha