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

fix(web): new feature photo #9443

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

fix(web): new feature photo #9443

wants to merge 1 commit into from

Conversation

martabal
Copy link
Member

fixes #9437.

Currently, if you edit the main photo and return to the /people page, the thumbnails displayed are the previous cached ones. This PR changes the behavior to always force the browser to fetch the latest thumbnails when the /people page is loaded

Copy link

cloudflare-pages bot commented May 13, 2024

Deploying immich with  Cloudflare Pages  Cloudflare Pages

Latest commit: b7ed1bc
Status: ✅  Deploy successful!
Preview URL: https://4fd79f45.immich.pages.dev
Branch Preview URL: https://fix-new-feature-photo.immich.pages.dev

View logs

@@ -433,6 +436,7 @@
{#each showPeople as person, index (person.id)}
<PeopleCard
{person}
{now}
Copy link
Contributor

Choose a reason for hiding this comment

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

Making this a props of the component that must be passed down from the parent component seems strange. Can we isolate this logic in the people-card component 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.

I tried at first, but if you search for a person and then go back to the full list, you won't use the cached thumbnails

Copy link
Contributor

Choose a reason for hiding this comment

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

This basically is equivalent to not using a cache to begin with, which is not ideal. We just need to reload the one image if/when it changes on the parent page. If you make a fetch request for it in the other component, will that refresh the cache so it is updated by the time you navigate here?

Copy link
Member Author

Choose a reason for hiding this comment

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

now in:

+page.svelte people-card
2024-05-13.23-20-02.mp4
2024-05-13.23-19-39.mp4

It's hard to see in a video, but when thumbnails are not cached it's not smooth

Copy link
Member Author

Choose a reason for hiding this comment

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

This basically is equivalent to not using a cache to begin with, which is not ideal. We just need to reload the one image if/when it changes on the parent page. If you make a fetch request for it in the other component, will that refresh the cache so it is updated by the time you navigate here?

let me try

Copy link
Member Author

Choose a reason for hiding this comment

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

From my testing, the only way to force the new feature photo to update is to change its thumbnail path (because the image source hasn't changed). So the solution requires a lot more changes (probably adding a new query parameter, parsing its value, updating thumbnailPath...?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updating Featured Photo does not refresh People page
3 participants