immich icon indicating copy to clipboard operation
immich copied to clipboard

chore(mobile): sync device album asset first

Open alextran1502 opened this issue 1 year ago • 3 comments
trafficstars

This PR changes the order of fetching assets on the mobile app to quickly show assets on the timeline by showing local assets first, then fetching remote assets and merging them together.

alextran1502 avatar Jun 27 '24 20:06 alextran1502

Did you encounter a situation where this change helps? Getting remote asset information is typically a lot faster than getting local metadata... (Unless you have 10 local assets and 100000 remote)

fyfrey avatar Jun 28 '24 06:06 fyfrey

@fyfrey I tested on my prod instance, in which I have 25_000 assets on my account, 60_000 assets on my partner sharing account, and about 7000 assets locally. First paint on the timeline is much quicker this way. Even if I sit next to 5Ghz AP, it takes about 5-6 seconds for the first paint if we fetch remote assets first

alextran1502 avatar Jun 28 '24 07:06 alextran1502

@alextran1502 alright, this is the case if the assets are already hashed. If you clear all app data / reinstall, hashing 7000 assets surely takes longer than the 5 seconds it takes to fetch remote info?

I guess the order of the two sync operations depends on what scenario we want to optimize :-)

fyfrey avatar Jun 28 '24 14:06 fyfrey