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

[C-1166] Avoid only primary image #2075

Merged
merged 3 commits into from
Oct 5, 2022
Merged

[C-1166] Avoid only primary image #2075

merged 3 commits into from
Oct 5, 2022

Conversation

raymondjacobson
Copy link
Member

@raymondjacobson raymondjacobson commented Oct 5, 2022

Description

The logic that handles fetching images from secondaries & legacy image formats is unfortunately split into two places:

Magic image component in native:

.map((gateway) => `${gateway}/ipfs/${user.profile_picture_sizes}`)

Libs: https://github.com/AudiusProject/audius-protocol/blob/6fdd8a88cb3d72da43743def17255c0fcc40edc7/libs/src/api/File.ts#L94

I think probably we want to move everything to magic image component in native, but this in the near-term makes all "Dynamic Images" work since the magic image thing in native isn't built to handle multiple sizes yet.

Curious for thoughts on this PR...!

At least this doesn't incur double fetch and we are doing some preloading!

Dragons

Is there anything the reviewer should be on the lookout for? Are there any dangerous changes?

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide repro instructions & any configuration.

Simulator, prod

Simulator Screen Shot - iPhone 14 Pro - 2022-10-04 at 21 27 09

For features that are critical or could fail silently please describe the monitoring/alerting being added.

Feature Flags

Are all new features properly feature flagged? Describe added feature flags.

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.

sweet i think im getting it, if my comments are on track?

const preloadedImageUrl = await preloadImage(firstImageUrl)
if (imagePreloader) {
try {
const preloaded = await imagePreloader(firstImageUrl)
Copy link
Contributor

Choose a reason for hiding this comment

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

so this preloads the image which then get's used by the Image component when it's paired with a url that matches what's been preloaded?

Copy link
Contributor

Choose a reason for hiding this comment

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

This also prevents a double fetch since we dont go through the cidCache + preloadImage section, and then the Image itself?

Copy link
Member Author

Choose a reason for hiding this comment

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

^ yep that's exactly right.

this is all overly complex & there are demons everywhere

Copy link
Contributor

Choose a reason for hiding this comment

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

well i started looking at this pr really not understanding the state of our images, so this was v helpful

@raymondjacobson raymondjacobson merged commit ebcfe62 into main Oct 5, 2022
@raymondjacobson raymondjacobson deleted the rj-c-1166 branch October 5, 2022 06:37
audius-infra pushed a commit that referenced this pull request Oct 8, 2022
[92ab4a0] [C-1184] Fetch lineups after coming back online (#2083) Andrew Mendelsohn
[b416893] Fix for if wallet has no transactions (#2109) Marcus Pasell
[ec8a713] Remove unused import (#2108) Marcus Pasell
[70c822e] If the user cancels, stop the flow (#2104) Marcus Pasell
[1ac824b] [PAY-610] Wire up Stripe modal to store (#2101) Marcus Pasell
[41ebb4a] Prepend saved tracks to saved lineup (#2106) Dylan Jeffers
[eade780] [C-1286] Add Hyperpop (#2105) Raymond Jacobson
[bf654d9] Require entropy to exist before setting up backend (#2100) Sebastian Klingler
[8ca0667] Only fetch favorites/profiles once (#2099) Dylan Jeffers
[0364b53] Set current_user_exists in async storage when entropy is synced (#2098) Sebastian Klingler
[a982942] Update SDK/Libs and call saveUserBankTransactionMetadata correctly (#2097) Marcus Pasell
[fbb5eac] Update Stripe crypto js URL (#2096) Marcus Pasell
[f55ef46] Update table styles to always display actions menu (#2091) Kyle Shanks
[6996013] BuyAudio Recovery Flow Fast Follows (#2071) Marcus Pasell
[f84bdce] [PAY-612] Add separate feature flags for enabling Coinbase/Stripe (#2095) Marcus Pasell
[027d30c] [C-1279] Improve drawer perf, improve bottom-bar navigation (#2092) Dylan Jeffers
[9098eaf] Remove unused setProvider and add action for recoveryFlow to prevent duplicate runs (#2094) Marcus Pasell
[e4f195c] Remove references to Coinbase in Stripe BuyAudioFlow (#2093) Marcus Pasell
[9eefe84] [PAY-670] New emoji error code (#2085) Michael Piazza
[f0b6df0] [C-1278] Improve bottom-tab-bar performance (#2090) Dylan Jeffers
[c02b391] Fix lint (#2088) Sebastian Klingler
[31a045e] Fix userChallengePolling on web (#2086) Marcus Pasell
[7959410] Remove extraneous navState log (#2087) Dylan Jeffers
[5b2566c] [C-977] Add Screen change analytics (#2082) Sebastian Klingler
[3beadc6] fix ci type error? (#2084) Marcus Pasell
[3063687] Trim whitespace properly on display name (#2079) Sebastian Klingler
[2f2d128] Remove track edit option from new dashboard table overflow menus (#2081) Kyle Shanks
[e6be524] [C-1246] Fix smart collections (#2078) Dylan Jeffers
[b920dde] Add feature-flag for artist dashboard new table, and update styles for qa issues (#2080) Kyle Shanks
[29cda2a] [C-1205] Improve splash screen animation (#2076) Dylan Jeffers
[6efdd6e] [C-1185] Get user challenge polling daemon working in native (#2077) Raymond Jacobson
[a961d68] Fix height of remixes tile (#2073) Sebastian Klingler
[ebcfe62] [C-1166] Avoid only primary image (#2075) Raymond Jacobson
[aba3b99] [C-1269] Fix now-playing drawer and scrubber (#2074) Dylan Jeffers
[3228d74] Fix notif subscription UI (#2072) Raymond Jacobson
[7570315] [C-1267] Fingerprint in react-native (#2070) Sebastian Klingler
[26abdd3] [C-1254] Fix debounced navigation (#2069) Dylan Jeffers
[cad36e3] [PAY-614][PAY-541] Add recovery flow and modal for buying $AUDIO (#2043) Marcus Pasell
[31698f3] fix random image (#2068) nicoback2
[1526acf] [C-1233] hide edit profile when offline (#2063) Andrew Mendelsohn
[d1aac19] Fix verified badge C-1178 (#2054) nicoback2
[203136b] [C-1221] Improve profile socials scroll target (#2067) Dylan Jeffers
[a368792] [C-1236] Ensures refresh spinner does not float over content (#2066) Dylan Jeffers
[8e2dedd] allow hiding keyboard when creating playlist (#2062) nicoback2
[b7e02ed] [C-1200] Improve lineup and bottom-tab perf (#2064) Dylan Jeffers
[ff9e223] Fix initial render condition (#2065) Dylan Jeffers
[32e6383] Prevent rendering root until account fetched (#2056) Dylan Jeffers
[fa2c9e8] Add try-catch blocks to artist dashboard sagas (#2061) Kyle Shanks
[907f45c] QA Updates for new artist dashboard table (#2060) Kyle Shanks
[4adfcdf] Add image backgrounds, animations, and small search bugfixes (#2057) Raymond Jacobson
[93a692a] [C-1209] Prompt use for notifications (#2058) Raymond Jacobson
[8cbf89a] [C-1226] Fix refresh stuck in loop (#2059) Dylan Jeffers
[21e69a0] [C-1027] Improve pull to refresh interaction (#2055) Dylan Jeffers
[396d63c] [C-1224] Prevent duplicate navigation pushes (#2053) Dylan Jeffers
[6b13afb] [C-1213, C-1216] Fix album artwork corners (#2052) Dylan Jeffers
[29853fe] [C-1201,C-1202] Improve search results rendering and perf (#2050) Dylan Jeffers
[83f8252] [C-1193] Fix oauth (#2047) Raymond Jacobson
[ee0b668] [C-972] Fix go-to-definition for common/stems (#2051) Dylan Jeffers
[00e9880] [PAY-668] Set up premium content (#2028) Saliou Diallo
[2a06bfd] Update loading states for favorites and collection page tables (#2045) Kyle Shanks
[ab3190d] Add AudioTransactionsPage and display tiest data in AudioTransactionsTable (#2033) Kyle Shanks
[9cea61a] Add cypress prober videos to artifacts C-1011 (#2049) nicoback2
@sliptype sliptype mentioned this pull request Nov 22, 2022
7 tasks
@AudiusProject AudiusProject deleted a comment from linear bot Sep 11, 2023
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.

2 participants