immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
38.27k stars 1.82k forks source link

No photos shown in Photos list when navigating to an Album via Photos, then back to Photos #9619

Open Snowknight26 opened 1 month ago

Snowknight26 commented 1 month ago

The bug

If you navigate to a photo that's part of an album from the Photos list, then navigate to an album that it's part of, attempting to go back (once to the photo, then once to the Photos list) shows nothing in the Photos list.

The OS that Immich Server is running on

Windows 10 22H2 (19045.4291)

Version of Immich Server

v1.105.1

Version of Immich Mobile App

N/A

Platform with the issue

Your docker-compose.yml content

N/A

Your .env content

N/A

Reproduction steps

1. Navigate to Photos
2. Click on a photo that's part of at least one album
3. Open the Info panel if it's not shown
4. Click on one of the albums in the Appears In section of the Info panel
5. Click the back button ("Close") in the top left or press escape to get back to the photo
6. Click the back button ("Go back") in the top left or press escape to get back to the Photos list

Relevant log output

No response

Additional information

Normally there's a call to /api/timeline/bucket?isArchived=false&size=MONTH&timeBucket=[time]&withPartners=true&withStacked=true when viewing the Photos list (via the Photos route?), but with these steps, completing step 5 doesn't trigger this call. My guess is some event isn't firing that triggers this/populates the list.

Snowknight26 commented 1 month ago

Coincidentally, if you do the reproduction steps up to and including step 4, then refresh the page, pressing back/escape doesn't show the issue.

The difference in behavior stems from web/src/routes/(user)/albums/[albumId=id]/[[photos=photos]]/[[assetId=id]]/+page.svelte, specifically in afterNavigate.

In the case of the reproduction steps, the backUrl is /photos/[id]. In other cases, such as when refreshing the /albums/[id] page with no prior navigation/referrer, the backUrl is /albums.

I imagine the AssetGrid is loaded differently in those two scenarios., which is what loads the data via a call to AssetStore.loadBucket.

Edit: Looking into it further, might be a difference in the way back is handled. The AssetViewer uses a back event, but the albums page uses a goto call with a specific URL (see above).

alextran1502 commented 1 month ago

@midzelis I think this might have something to do with hard url navigation, correct?