Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Fix validation on access and sale modal #3981

Merged
merged 6 commits into from
Aug 30, 2023

Conversation

amendelsohn
Copy link
Contributor

Description

Fixes release-blocking issue with access and sale modal.

Fixes

  • Form was not able to be submitted when a validation error was present in other hidden fields
  • Cleans form values when swapping between availability types

How Has This Been Tested?

local web

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.

Noticed on stage I was unable to change access from gated to public and have it stick? Is that related?

if (isPremiumContentUSDCPurchaseGated(formValues[PREMIUM_CONDITIONS])) {
return (
formValues[PREVIEW] === undefined ||
(formValues[PREVIEW] >= 0 && formValues[PREVIEW] < trackLength - 15)
Copy link
Contributor

Choose a reason for hiding this comment

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

fwiw it turns out track previews are implemented on the content end as 30s, so maybe easiest to update the UI side? Either way, maybe a comment/constant for the 15 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah great call. I'll make it 30 before the end

@audius-infra
Copy link
Collaborator

@amendelsohn
Copy link
Contributor Author

amendelsohn commented Aug 30, 2023

Noticed on stage I was unable to change access from gated to public and have it stick? Is that related?

Digging into this... looks like we're calling confirmEditTrack with premium_conditions: null and is_premium: false. Wondering if the null is getting dropped during the entity merge not replacing the premium conditions?

When the track reloads later, it has premium_conditions: { follower_id: 12345 } but is_premium: false, and the dog ear is visible but not the "Special Access" label

@rickyrombo
Copy link
Contributor

rickyrombo commented Aug 30, 2023

Noticed on stage I was unable to change access from gated to public and have it stick? Is that related?

Digging into this... looks like we're calling confirmEditTrack with premium_conditions: null and is_premium: false. Wondering if the null is getting dropped during the entity merge not replacing the premium conditions?

When the track reloads later, it has premium_conditions: { follower_id: 12345 } but is_premium: false, and the dog ear is visible but not the "Special Access" label

That sounds like what's happening. https://github.com/AudiusProject/audius-protocol/blob/7b3120fd1da44563bd5530698ac91ab6c49a2594/discovery-provider/src/tasks/entity_manager/entities/track.py#L220-L226

Maybe we should send an empty object for premium conditions?

CC: @sliptype was that the intent with premium conditions check in entity_manager/track.py ?

Copy link
Contributor

@dylanjeffers dylanjeffers left a comment

Choose a reason for hiding this comment

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

Awesome. Now just checking the usdc field is hidden in prod anyway right?

@@ -109,12 +109,12 @@ const messages = {
errors: {
price: {
tooLow: 'Price must be at least $0.99.',
tooHigh: 'Price must be less than $9.99.'
tooHigh: 'Price must be less than $9999.99.'
Copy link
Contributor

Choose a reason for hiding this comment

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

Lol

@audius-infra
Copy link
Collaborator

@amendelsohn
Copy link
Contributor Author

Maybe we should send an empty object for premium conditions?

Oof sent premium_conditions: {} but still getting old premium_conditions: { follower_id: 123 } from discovery after confirmation.

@amendelsohn
Copy link
Contributor Author

Awesome. Now just checking the usdc field is hidden in prod anyway right?

Correct, though the other bug affects prod track edit

@amendelsohn amendelsohn merged commit 7493cff into main Aug 30, 2023
2 checks passed
@amendelsohn amendelsohn deleted the amendel-access-sale-regression-fix branch August 30, 2023 22:53
audius-infra pushed a commit that referenced this pull request Sep 4, 2023
[533affd] Commit package-lock sliptype
[30596c5] Disable setup sliptype
[a4af082] Disable branch filter sliptype
[62c3391] Fix versions sliptype
[60943ec] [C-3032] Fix collectible gated upload (#4012) Dylan Jeffers
[bcf3473] [C-3035] Stale stats for offline tracks (#4010) Dylan Jeffers
[6af2a34] Prepare 1.5.40 full app release (#4011) Dylan Jeffers
[c19274a] [PAY-1791] Withdraw USDC - transfer to dest account (#4002) Reed
[c36e63a] [C-3004] Scroll to top when switching tracks in upload (#4006) Andrew Mendelsohn
[8c2966b] [C-3014] Add prompt on leaving upload form in progress (#3989) Andrew Mendelsohn
[df42ea2] CI fixes for mobile (#4008) Sebastian Klingler
[0d32111] [PAY-1723] Purchase content twitter share copy (#4005) Reed
[a6585df] [PAY-1764] Update USDCCard icons in artist dashboard (#4003) Reed
[92d839b] [C-3031] Fix transaction history numbers (#4001) Dylan Jeffers
[2e6aef3] Remove unused TrackAvailabilityModal (#3994) Andrew Mendelsohn
[6572576] [PAY-1734] Implement skeleton withdraw USDC modal (#3999) Raymond Jacobson
[a1a2feb] [C-3017] Reset the new upload flow state when the upload button in the side nav is clicked (#4000) Kyle Shanks
[294e7b3] [C-2954] Fix hashtag search (#3998) Dylan Jeffers
[7587308] Add category to library query endpoint + more useAllPaginated fixes (#3975) nicoback2
[028e570] Fix CI (partially) (#3997) Sebastian Klingler
[9b6c3e4] [C-2915] Implement Mobile USDC field (#3992) Dylan Jeffers
[4e3c260] Fix AI learn more link (#3996) Reed
[fe6cdbc] Fix misc embed deploy issues (#3995) Raymond Jacobson
[42ca343] [C-3028] make the usdc inputs white (#3991) Andrew Mendelsohn
[9f79838] [PAY-1776] Fix playing check for track page (#3993) Randy Schott
[e0cd67d] [PAY-1591][PAY-1775] Implements content previews on native mobile (#3986) Randy Schott
[a95a733] [C-2995] Add hint to modal radio items (#3990) Kyle Shanks
[6b139db] [C-3029] Fix embed environment url (#3987) Dylan Jeffers
[ec3a09d] [C-3022] Fix broken multi-track index after deleting (#3988) Andrew Mendelsohn
[1ef154d] [PAY-1736] Implement new ArtistCard on dashboard (#3984) Raymond Jacobson
[0df700b] Update files to account for changes on node 18 (#3985) Raymond Jacobson
[d633a29] [PAY-1786] Withdraw USDC - create dest token account (#3982) Reed
[fa060e2] [PAY-1755] Withdraw USDC flow: send signature to relay (#3980) Reed
[b0d1d48] Add HarmonySelectablePill for mobile + Library filter pill menu (#3974) nicoback2
[cc723a1] Revert premium_conditions empty object change (#3983) Andrew Mendelsohn
[7493cff] Fix validation on access and sale modal (#3981) Andrew Mendelsohn
[a2b0890] Fix maxLength warning in search bar (#3979) Dylan Jeffers
[9ba4c7b] [PAY-1761] Display USDC balance on artist dashboard (#3971) Reed
[d47cd69] Fix TextField input spacing (#3978) Dylan Jeffers
[83b7ae5] [PAY-1590] Hook up content previews for USDC content (#3968) Randy Schott
[0ce85a2] [C-2921] Update subgenre value passed in the genre field (#3977) Kyle Shanks
[c48179f] Fix text color for DMs (#3976) Marcus Pasell
[559e50e] Improve sentry-cli usage in CI (#3972) Sebastian Klingler
[0a4cca7] [PAY-1768] Convert artist dashboard to functional component (#3970) Reed
[a171858] Fix embed ci with workspaces (#3969) Sebastian Klingler
[bc73bef] Fix jupiter Buffer is not defined (#3967) Sebastian Klingler
[3945552] [C-3026] Close now-playing when sharing to dm (#3966) Dylan Jeffers
[8be4f39] [C-2999] Verify calendar input styles and update text when finalizing upload (#3965) Kyle Shanks
[77aa099] [C-3020] Fix errors in usdc purchase field (#3964) Andrew Mendelsohn
[c133a9c] [INF-445] Upgrade client to node 18, npm 9, and npm workspaces (#3927) Sebastian Klingler
[650a6e2] [PAY-1506] USDC artist dashboard tile (#3963) Reed
[68bba0d] [PAY-1715] Adds Sales page (#3957) Randy Schott
[7d2f718] [PAY-1712] Implement purchases page (#3951) Randy Schott
[314087b] [C-3025] Fix race-condition with stem/remix fetch (#3961) Dylan Jeffers
[de2e27c] [C-3023] Fix collectible visibility (#3960) Dylan Jeffers
[a0a5a84] [C-3012] Fix remixes deep link (#3958) Dylan Jeffers
[9c2154c] [C-3018][C-2965] fix upload album/playlist description field styling (#3959) Andrew Mendelsohn
[7cd1b00] [C-2791] Use artwork from the file if there is one (#3956) Andrew Mendelsohn
[16c07ef] [C-3015] Add back button to new upload flow edit page (#3955) Kyle Shanks
[353ca55] [C-2997] Disable delete on the last collection upload track (#3954) Kyle Shanks
[f8dcd92] [C-3001, C-3003] Fix new upload flow error formatting (#3953) Kyle Shanks
[4727ef4] [C-3000] Update audio file type icons (#3952) Kyle Shanks
[1a2ce2a] [C-3002] Fix casing of selected values in upload flow (#3950) Kyle Shanks
[dc3ed39] [C-3006][C-3005] Fix tag field wrapping (#3947) Andrew Mendelsohn
[d047fda] Fix Share to IG/T/S sticker consistency [C-3009] (#3949) nicoback2
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants