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

[BUG] Conflict in copy: File without extension #4294

Merged
merged 8 commits into from
Jan 26, 2024

Conversation

Aitorbp
Copy link
Contributor

@Aitorbp Aitorbp commented Jan 23, 2024

Related Issues

App: #4222

  • Added changelog files for the fixed issues in folder changelog/unreleased. More info here

QA

@Aitorbp Aitorbp self-assigned this Jan 23, 2024
@Aitorbp Aitorbp force-pushed the fix/conflict_copy_file_without_extension branch from 9041c58 to b57b718 Compare January 23, 2024 10:13
@Aitorbp Aitorbp linked an issue Jan 23, 2024 that may be closed by this pull request
@Aitorbp
Copy link
Contributor Author

Aitorbp commented Jan 23, 2024

The startsWith function will not work with files that lack an extension for the following reason:
If we have a file called test and we want to copy this same file to the same folder. The file will behave as follows:

“test (1)”.startsWith(“test”)

This function will return true and therefore enter the INVALID_COPY_INTO_DESCENDANT exception, since the prefix is the same.

The behavior with extension would be the following:

“test (1).log”.startsWith(“test.log”)

The test.log prefix is not contained in the target therefore it will return false. With a folder it has the same behavior, only instead of having an extension it has a slash / at the end.

I remove the startsWith condition from the CopyRemoteFileOperation class and keep this logic in the CopyFileUseCase, where these exceptions are being handled.

@Aitorbp Aitorbp force-pushed the fix/conflict_copy_file_without_extension branch from 44430f0 to 0dc9ea1 Compare January 23, 2024 10:45
Copy link
Collaborator

@JuancaG05 JuancaG05 left a comment

Choose a reason for hiding this comment

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

Check the comments about the calens file, and go ahead with the other issue after finishing this one

changelog/unreleased/4294 Outdated Show resolved Hide resolved
changelog/unreleased/4294 Outdated Show resolved Hide resolved
@Aitorbp Aitorbp force-pushed the fix/conflict_copy_file_without_extension branch from 6a238ce to f86993b Compare January 24, 2024 10:45
@Aitorbp Aitorbp requested a review from JuancaG05 January 24, 2024 11:08
Copy link
Collaborator

@JuancaG05 JuancaG05 left a comment

Choose a reason for hiding this comment

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

LGTM

@Aitorbp Aitorbp force-pushed the fix/conflict_copy_file_without_extension branch from fc0dcc3 to e2a9ae8 Compare January 25, 2024 07:39
@jesmrec
Copy link
Collaborator

jesmrec commented Jan 25, 2024

Fixed

@jesmrec
Copy link
Collaborator

jesmrec commented Jan 25, 2024

Dont merge till #4295 is also approved

…nt_in_different_spaces

[BUG] Invalid copy into descendant in different spaces
@Aitorbp Aitorbp merged commit 440ff46 into master Jan 26, 2024
5 checks passed
@Aitorbp Aitorbp deleted the fix/conflict_copy_file_without_extension branch January 26, 2024 09:40
Aitorbp added a commit that referenced this pull request Feb 5, 2024
…_extension

[BUG] Conflict in copy: File without extension
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Conflict in copy: File without extension
3 participants