Parse-Swift
Parse-Swift copied to clipboard
Error while query users with emails that contains +(plus) character
trafficstars
New Issue Checklist
- [x] I am not disclosing a vulnerability.
- [x] I am not just asking a question.
- [x] I have searched through existing issues.
- [x] I can reproduce the issue with the latest versions of Parse Server and the Parse Swift SDK.
Issue Description
When I try to query object from my database (based on back4app) with email that contains +(plus) characters I got Parse Error "Object not found". If I try to query objects with email that contains other special characters- "_" or "." everything working ok.
Steps to reproduce
- create _User object with email that contains +(plus) character. For example "[email protected]"
- fetch parse object from swift code (example with login below )
func login(user: ParseUserObject) async throws {
guard let email = user.email?.lowercased(), let password = user.password else {
throw ParseError.Code.unknownError
}
// Fetch username from Parse(user provide only email/pass for login)
var constraints = [QueryConstraint]()
constraints.append(equalTo(key: "email", value: email))
let query = ParseUserObject.query(constraints)
let parseUser = try await query.first()
// or you can use
// let query = ParseUserObject.query("email" == email.lowercased())
guard let username = parseUser.username else {
throw ParseError.Code.unknownError
}
try await ParseUserObject.login(username: username, password: password)
setIsAuthorized(true)
}
Actual Outcome
try await query.first() throw an Parse Error (object not found)
Expected Outcome
Existing object
Environment
Xcode, iOS simulator (or physical iPhone), parse database based on back4app service
Client
- Parse Swift SDK version:
4.14.2 - Xcode version:
15.4 - Operating system (iOS, macOS, watchOS, etc.):
iOS - Operating system version:
18.0
Server
- Parse Server version:
3.10.0 - Operating system:
Linux(maybe) - Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
back4app server
Database
- System (MongoDB or Postgres):
MongoDB - Database version:
3.6 - Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
back4app server
Logs
▿ ParseError code=101 error=Object not found on the server.
- code : ParseSwift.ParseError.Code.objectNotFound
- message : "Object not found on the server."
- otherCode : nil
- error : nil