Skip to content
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

FIX: TYPEORM postgresql (...Emails) syntax bad handling in #1205 #1279

Merged
merged 4 commits into from
Oct 30, 2024

Conversation

hexaltation
Copy link
Collaborator

Context

PR #1205 introduced a regression with postgreSQL.
The present PR addresses it.

Proposed solution

As a workaround of TYPEORM postgresql (...Emails) syntax handling. The code now returns an empty Array if there is no emails given to get existing users.

Related issues

#1005

Has this been tested?

yes locally with a psql database.

Copy link
Collaborator

@fflorent fflorent left a comment

Choose a reason for hiding this comment

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

Thanks!

Tests are failing, these are due to a regression already present on main.

That's another subject, but what worries me is that it may be a shadow upgrade of some component that breaks stuffs. The first commit which shows the problem is unrelated to the code:
0b0ca2c

Anyway, that looks good to me!

@berhalak
Copy link
Contributor

Hi @hexaltation,

Can you add a test case to the ./test/gen-server/lib/homedb/UsersManager.ts ?

@fflorent
Copy link
Collaborator

Hi @berhalak

Can you add a test case to the ./test/gen-server/lib/homedb/UsersManager.ts ?

The problem is that we may add the test case, Sqlite will recognize the IN () clause whereas Postgresql won't. And this test file only test using Sqlite. So the test won't detect any regression.

I attempted to make the tests run using Postgresql in #1278 but many tests already fail.

@hexaltation
Copy link
Collaborator Author

Hello @berhalak,

Can you add a test case to the ./test/gen-server/lib/homedb/UsersManager.ts ?

Yes I can do it, nevertheless as @fflorent says the test will never fail as long as the CI only tests sqlite.
Does your fabrikator toolchain tests the code against postgre?
It could be a great improvement to add it to the github CI.

@hexaltation
Copy link
Collaborator Author

And I realize that the new function getUsersByLogins() is never tested.
So for sure I add tests for it.

@berhalak
Copy link
Contributor

Hello @berhalak,

Can you add a test case to the ./test/gen-server/lib/homedb/UsersManager.ts ?

Yes I can do it, nevertheless as @fflorent says the test will never fail as long as the CI only tests sqlite. Does your fabrikator toolchain tests the code against postgre? It could be a great improvement to add it to the github CI.

Yes, our internal CI should run this test against postgres.

Copy link
Collaborator

@fflorent fflorent left a comment

Choose a reason for hiding this comment

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

Few comments, globally LGTM

Copy link
Contributor

@berhalak berhalak left a comment

Choose a reason for hiding this comment

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

Thank you!

@jordigh
Copy link
Contributor

jordigh commented Oct 30, 2024

I have rebased the branch to re-run the CI on main after #1283

@hexaltation
Copy link
Collaborator Author

Thank you @berhalak & @jordigh

@jordigh jordigh merged commit 3f92caa into gristlabs:main Oct 30, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants