-
Notifications
You must be signed in to change notification settings - Fork 362
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
v3.31.0 introduces bug #1754
Comments
It seems to be related to 4f31db1. |
@ataft Can you check #1755 to see if I'm missing something for a test I wrote using your scenario? I am not able to reproduce your issue with it:
Here is the User model definition that I used. |
@ataft can you share a sandbox app to reproduce the failure if that's easier? Please also include the steps you took to see the error. |
Test looks OK, but it does differ from mine in that it doesn't include "username". Perhaps if you tried:
I doubt this will make it fail though. It's probably some other difference between our environments (I'm on loopback version 3.17.1). I'll try to reproduce the issue with a sandbox app, but for now I'm just going to stick on juggler v3.30.0. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the |
OK, I finally figured out what was causing this error. I'm using the "defineProperty" function, like this: In the loopback-datasource-juggler, this causes the DataType to be Then, it throws an error any time "email" is used in the where clause, e.g.
It has nothing to do with using "OR", like I originally thought. Here's a sandbox that shows the issue: |
@b-admike I see that @raymondfeng comment about it being related to 4f31db1 is spot on |
@ataft thank you for the update. Would you like to contribute the fix yourself? I am not sure if you are using app.models.User.defineProperty('email', {
type: 'string',
required: false,
}); |
Thanks @bajtos , adding I'm not sure I'm doing this properly, but I want to use the built-in User model without email for auth providers like LDAP and Active Directory. Let me know if there's a better way. |
The following code works fine in v3.30.0:
As of v.3.31.0, I get the following error:
Looks like something broke in the _coerce function.
The text was updated successfully, but these errors were encountered: