Skip to content

Fix fragile arguments.length check in findByEmailOrUsername#3932

Merged
raclim merged 4 commits intoprocessing:developfrom
SinhaS12:fix/User-Model
Mar 10, 2026
Merged

Fix fragile arguments.length check in findByEmailOrUsername#3932
raclim merged 4 commits intoprocessing:developfrom
SinhaS12:fix/User-Model

Conversation

@SinhaS12
Copy link
Copy Markdown
Contributor

@SinhaS12 SinhaS12 commented Feb 24, 2026

Issue:

Fixes #3911
findByEmailOrUsername() used arguments.length === 2 to decide whether to run a case-insensitive query. This is fragile and can behave inconsistently when the function is called with extra arguments (e.g. wrappers) or different call styles.

Demo:

N/A (server-side logic change; no UI change).

Changes:

  • Remove the arguments.length === 2 condition from the case-insensitive branch.
  • Control case-insensitive behavior by explicitly checking options?.caseInsensitive.

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • has no typecheck errors (npm run typecheck)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123

Copy link
Copy Markdown
Collaborator

@raclim raclim left a comment

Choose a reason for hiding this comment

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

Thanks @SinhaS12 and @clairep94!

@raclim raclim merged commit a5c68ce into processing:develop Mar 10, 2026
1 check passed
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.

User model: fragile use of arguments.length in findByEmailOrUsername

3 participants