Skip to content

Conversation

@TamaraFinogina
Copy link
Contributor

This PR sets the name equal to plainName instead of its encrypted version.

bucketId: string,
): Promise<[Folder, Folder, Folder]> {
const rootFolderName = this.cryptoService.encryptName(`${v4()}`);
const rootFolderName = v4();
Copy link
Member

Choose a reason for hiding this comment

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

I do not know the side effects of this case. A root folder's name should not be decrypted in any case, as there is no level above it and thus, it does not have any folders at its same level too.

LGTM assuming that, but double check it @jzunigax2


const folderWithSameNameExists = await this.folderRepository.findOne({
name: cryptoFileName,
name: newFolderMetadata.plainName,
Copy link
Member

Choose a reason for hiding this comment

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

This could not be done, it's not consistent. The already existent items have their names encrypted. The new ones won't. You may introduce an OR here. Or even better: switch from findOne using the name to use the plainName, as we should deprecate this field.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Switched to plainName for findOne: f713435

Copy link
Member

@sg-gs sg-gs left a comment

Choose a reason for hiding this comment

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

Left some comments @TamaraFinogina

@sonarqubecloud
Copy link

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