Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PAY-2030] Use cooldown_days from backend instead of hardcoding #6597

Merged
merged 10 commits into from
Nov 9, 2023

Conversation

dharit-tan
Copy link
Contributor

@dharit-tan dharit-tan commented Nov 7, 2023

Description

  • Remove hardcoded COOLDOWN_DAYS and use value from api response instead.
  • Fix a subtle bug where challenges with created_at that crosses the date boundary when converting from utc to local time would be bucketed into the wrong bin. Decided to draw a line between all UI-related date calculations which should be done in local time, vs. using utc when figuring out whether a challenge is claimable or not.

Depends on #6604

How Has This Been Tested?

Local web dev

Test data:

discovery_provider_1=# select challenge_id, specifier, amount, created_at from user_challenges where challenge_id = 'b' order by created_at desc;
 challenge_id |       specifier       | amount |          created_at
--------------+-----------------------+--------+-------------------------------
 b            | 768484728=>357517808  |      2 | 2023-11-07 02:52:06.721132+00
 b            | 768484728=>425796167  |      4 | 2023-11-07 02:51:56.728657+00
 b            | 768484728=>1590051877 |      3 | 2023-11-06 21:33:34.088129+00
 b            | 768484728=>1865433894 |      5 | 2023-11-01 22:15:18.65889+00
 b            | 768484728=>137056909  |      2 | 2023-10-31 22:15:18.65889+00
(5 rows)
Screenshot 2023-11-06 at 11 43 57 PM Screenshot 2023-11-06 at 11 43 57 PM

@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/rt-cooldown-cleanup

Copy link
Contributor

@rickyrombo rickyrombo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good looks with the conversion to local time, and also the mobile fix and moving utils to common!

Copy link
Member

@raymondjacobson raymondjacobson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will we have problems if client is deployed before discovery?

@pull-request-size pull-request-size bot added size/M and removed size/L labels Nov 7, 2023
@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/rt-cooldown-cleanup

@dharit-tan
Copy link
Contributor Author

will we have problems if client is deployed before discovery?

yes - i've moved the fix for the bug in mobile to its own commit and deployed that. that one doesn't rely on backend changes. i'll leave this commit on staging and let it roll out normally and by then DNs will have been updated.

@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/rt-cooldown-cleanup

packages/common/src/utils/challenges.ts Outdated Show resolved Hide resolved
@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/rt-cooldown-cleanup

@audius-infra
Copy link
Collaborator

Preview this change https://demo.audius.co/rt-cooldown-cleanup

@dharit-tan dharit-tan merged commit 65092e7 into main Nov 9, 2023
3 checks passed
@dharit-tan dharit-tan deleted the rt-cooldown-cleanup branch November 9, 2023 19:47
audius-infra pushed a commit that referenced this pull request Nov 11, 2023
[54bd272] [C-3265] Ensure text-input doesn't need explicit role (#6660) Dylan Jeffers
[af284fb] [C-3350] Add contributing guide (#6658) Dylan Jeffers
[221c4c4] [C-3345] Fix TOC links (#6657) Dylan Jeffers
[6f265d0] Add sign up white screen progress header C-3320 (#6650) nicoback2
[bd2ab5e] Handle page - main content and manual entry functionality C-3319 (#6625) nicoback2
[f8e5bcc] Fix small issues with client CI announcements (#6659) Raymond Jacobson
[f448bd4] Fix developer app metrics C-3248 (#6656) nicoback2
[4220328] Fix harmony logo link and title (#6640) Andrew Mendelsohn
[7b31422] [C-3349] Fix internal links (#6652) Dylan Jeffers
[0c1fc5b] Improve cypress config ergo and fix smoke tests after vite (#6653) Raymond Jacobson
[879a73e] [C-3287] Add Harmony TextInput docs (#6651) Kyle Shanks
[99919c6] [C-3333] Add harmony link unfurl (#6649) Dylan Jeffers
[4ef98f1] [C-3344] Organize and sort stories (#6648) Dylan Jeffers
[2c3b849] [C-3343] Simplify and fix theme switcher (#6647) Dylan Jeffers
[1c2d54c] [C-3325] Add SelectablePill docs (#6646) Dylan Jeffers
[8e9f4aa] Bump version to 0.5.14 audius-infra
[749c240] [PAY-2126] Fix now playing play bar layouts (#6645) Raymond Jacobson
[effeb6b] Gate client release version and add slack notifs (#6626) Raymond Jacobson
[090ad1c] Move link to storybook components (#6644) Andrew Mendelsohn
[71284ee] [C-3339] Update storybook layout (#6642) Dylan Jeffers
[270dd62] Update meta pixel id (#6643) Raymond Jacobson
[51a2b49] Remove magic number for $AUDIO decimals in buy-audio flow (#6641) Reed
[9ffda85] [C-3334] Add harmony favicons (#6631) Dylan Jeffers
[62de2d4] Update default RPCs (#6639) Raymond Jacobson
[6b0e9a3] [C-3340] Fix do's and don'ts styling (#6638) Andrew Mendelsohn
[7d15a29] Add meta pixel (#6637) Raymond Jacobson
[52b88ab] [PROTO-1417] Expose uptime via /up route (no styling) (#6627) Theo Ilie
[a1bc8b0] [PAY-2150] Make total audio claimed color default (#6633) Saliou Diallo
[9f1e4f3] [C-3341] Clean up Harmony Button docs (#6636) Kyle Shanks
[bd10a15] [C-3317] Add component welcome doc (#6612) Dylan Jeffers
[5658ba2] Remove unnecessary hardcoded list of challenges (#6634) Reed
[97e0664] [C-3323] Add Harmony Divider docs (#6629) Kyle Shanks
[05860eb] Fix wrong bg color in mobile ready to claim pill (#6635) Reed
[65092e7] [PAY-2030] Use cooldown_days from backend instead of hardcoding (#6597) Reed
[c4afdc0] [PAY-2145] Rename v2 landing page items (#6628) Saliou Diallo
[99bad78] Fix emotion and css-modules specificity (#6632) Dylan Jeffers
[35f87fa] [INF-542] Fix vite_public_url (#6630) Sebastian Klingler
[a09fb82] [C-3288] Add component statuses (#6624) Dylan Jeffers
[6c6c2f3] Bump version to 0.5.13 audius-infra
[132fe23] [C-3338] Fix harmony internal links (#6623) Andrew Mendelsohn
[21224f8] [C-3327] Add Icon docs (#6606) Dylan Jeffers
[b18accb] Add reset.css to storybook global.css (#6621) Dylan Jeffers
[19f2dd5] Add  matching challenges to claimable challenges (#6622) Reed
[25fd376] Fix lint (#6620) Raymond Jacobson
[2555c1d] [C-3329] Add harmony docs dark-mode (#6616) Dylan Jeffers
[68107ee] [INF-540] Fix popup location (#6619) Sebastian Klingler
[050b2fa] [PAY-2096] Validate remixability of premium content in DN indexing (#6594) Saliou Diallo
[969a896] [C-3315] Update harmony button to emotion (#6605) Kyle Shanks
[6c45cfb] Assert protocol in oauth redirect_uri (#6618) Raymond Jacobson
[82b0ce9] [PROTO-1411] Add standalone uptime check container with BoltDB (#6610) Theo Ilie
[2778bbe] [PAY-2106] Adds tracking of opening source for purchase modal (#6603) Randy Schott
[2a91b1b] Add file-loader to fix harmony storybook (#6617) Dylan Jeffers
[aed8167] [C-3322, C-3324] Add Box and Flex docs to storybook (#6607) Andrew Mendelsohn
[36bbfe1] [C-3259] Add Avatar component to harmony (#6595) Andrew Mendelsohn
[84a497a] Fix total audio claimed amount for aggregate challenges (#6614) Reed
[f03cb2d] fix release for arm (#6615) Alec Savvy
[2285436] [INF-538] Fix filetype icons in upload broken due to vite migration (#6613) Sebastian Klingler
[3134f3a] Bump version to 0.5.12 audius-infra
[bbddaed] [PAY-2068] Move dayjs to common package (#6609) Raymond Jacobson
[70ed333] Fix rewards layout issues after vite (#6611) Raymond Jacobson
[df86987] [PAY-1850] Remove fn callback from withdraw USDC action (#6608) Reed
[4daef8d] Add cooldown_days to challenges api response (#6604) Reed
[97eb73d] [C-3318] Add related-foundations (#6600) Dylan Jeffers
[a578572] [C-3316] Add foundations welcome doc (#6592) Dylan Jeffers
[561f253] Fix Audius appearing to be not followed after signup QA-678 (#6564) nicoback2
[6020747] [INF-491] Move embed to vite (#6599) Raymond Jacobson
[d6d3382] [PROTO-1410] Self hosted ci: make startup script idempotent, perform full docker prune. (#6601) Danny
[8006dc8] Abstract peer health from mediorum to run standalone (#6533) Michelle Brier
[e183826] Only claim challenges past cooldown on mobile (#6602) Reed
[d23c978] build and push for arm (#6470) Alec Savvy
[9af449a] Bump version to 0.5.11 audius-infra
[fd12b98] [PAY-2091] Update aao error emojis and libs mapped error (#6593) Saliou Diallo
[73e7572] Reinstall pino to fix missing on-exit-leak-free in @pedalboard/relay (#6596) Sebastian Klingler
[3dc0d2b] [C-3326] Update harmony welcome docs (#6591) Dylan Jeffers
[bdcebd9] make mediorum module importable (#6586) Alec Savvy
[9518d18] [C-3321] Add harmony docs theme (#6588) Dylan Jeffers
[75836f5] [Cherry pick] Fix `StatusMessage` validation check (#6587) nicoback2
[6c473bb] ⚠️ [INF-507] Migrate from CRA to Vite (#6567) Sebastian Klingler
[1023053] [PAY-2108] Migrate USDC manual transfer modal to common slice (#6590) Randy Schott
[e468830] [PAY-1977] Drop avenir condensed and gilroy fonts (#6362) Raymond Jacobson
[cb57235] Scheduled releases poc (#6513) Isaac Solo
[61f2bcd] [PAY-2107] Switch purchase drawer to use common modal slice on mobile (#6589) Randy Schott
[7fcf4d3] Restart signup flow isaac
[5f46bc2] Fix PasswordInput lint (#6585) Dylan Jeffers
[4bd9789] Bump version to 0.5.10 audius-infra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants