Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Fixing some $like searches on projects #8695

Merged
merged 1 commit into from
Sep 8, 2023
Merged

Conversation

barankyle
Copy link
Member

@barankyle barankyle commented Sep 8, 2023

Summary

Some functions that were searching on project names via $like: %% were returning hits that it shouldn't have gotten, e.g. finds on project-name getting hits on projects project-name and project-name-avatars. If the bad hits happened to come first in the array because their ID happened to come first, this would result in unwanted behavior like patching the wrong project.

Removed the %'s in these queries, which match additional characters. We only use $like for case-insensitivity purposes.

References

closes #8694

Checklist

  • If this PR is still a WIP, convert to a draft
  • When this PR is ready, mark it as "Ready for review"
  • ensure all checks pass
  • Changes have been manually QA'd
  • Changes reviewed by at least 2 approved reviewer

QA Steps

List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.

Some functions that were searching on project names via $like: %<name>%
were returning hits that it shouldn't have gotten, e.g. finds on `project-name`
getting hits on projects `project-name` and `project-name-avatars`. If the bad
hits happened to come first in the array because their ID happened to come first,
this would result in unwanted behavior like patching the wrong project.

Removed the %'s in these queries, which match additional characters. We
only use $like for case-insensitivity purposes.
@barankyle barankyle added this pull request to the merge queue Sep 8, 2023
Merged via the queue into dev with commit 44f46af Sep 8, 2023
6 of 8 checks passed
@barankyle barankyle deleted the 8694-project-name-fixes branch September 8, 2023 01:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Use of $like: projectName in project.update can change record of wrong project
2 participants