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(server): only allow absolute import paths #13642

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

etnoy
Copy link
Contributor

@etnoy etnoy commented Oct 21, 2024

I've seen more than one occasion of users specifying relative paths in their library import paths, one example is #13570.

Apparently, the path validator accepts a relative path as input while it fails when we do the actual scan. This PR ensures that relative paths fail validation as well as give a helpful message to the user which path they possibly are referring to

This is possibly a breaking change since users that currently use relative paths will fail validation

server/src/cores/storage.core.ts Outdated Show resolved Hide resolved
@alextran1502
Copy link
Contributor

What is the behavior of this breaking change? If a user used a a relative path before, what action must they take to have the library working correctly?

@etnoy
Copy link
Contributor Author

etnoy commented Oct 21, 2024

What is the behavior of this breaking change? If a user used a a relative path before, what action must they take to have the library working correctly?

I didn't mark this as breaking because a user who used a relative path as import path will already be experiencing the issues mentioned in #13570.

Before this PR, they would be none the wiser as to why assets are trashed.

After this PR, they will get help: in the library page they will see that the path is failing validation. When they hover over the checkbox, they will learn they should use an absolute path, and Immich will even tell them which path to put in there to fix it.

I therefore think we don't need to put this as a breaking change.

@alextran1502 alextran1502 merged commit b411e30 into main Oct 21, 2024
36 checks passed
@alextran1502 alextran1502 deleted the fix/absolute-import-path branch October 21, 2024 14:12
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.

3 participants