Skip to content

fix(web): MemoryStore does not initialize on direct navigation - #18947

Merged
alextran1502 merged 5 commits into
immich-app:mainfrom
xCJPECKOVERx:fix/open-memory-in-new-tab
Jun 17, 2025
Merged

alextran1502 merged 5 commits into
immich-app:mainfrom
xCJPECKOVERx:fix/open-memory-in-new-tab

Conversation

@xCJPECKOVERx

@xCJPECKOVERx xCJPECKOVERx commented Jun 5, 2025 •

Copy link
Copy Markdown
Collaborator

Description

The memory store doesn't load when navigating directly to the memories page. As a consequence, opening assets in the memory gallery-viewer in a new tab does not load.

The memory-viewer was returning early when navigating directly (type === 'enter'), with a reason of duplicate initialization. I can't get this to occur now, and the memoryStore has protections against re-initialization, so I think it is fine to allow direct navigation to load like normal.

Fixes #18870

How Has This Been Tested?

Perform any of the following, and confirming with console logs that afterNavigate isn't called multiple times, while still allowing the memories and gallery to initialize.

  • Navigating directly to a memory url
  • Navigating directly to a memory's asset url (gallery asset-viewer view)

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

@@ -265,7 +265,7 @@
if (type === 'enter') {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If this doesn't happen anymore, probably good to remove this whole conditional block to avoid confusing others

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I left it commented just in case it happened to be a regression and had to be modified further.
So instead, it's best to remove updates like this entirely, and if we have to undo we can just check previous versions?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, preferably we like to keep the code base clean

@alextran1502
alextran1502 merged commit 15c488c into immich-app:main Jun 17, 2025
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.

2 participants