backend: move mentionedUsers query to mention handler #134

Merged
norm merged 2 commits from fix/backend-toHtml-mentionedUsers into main 2022-09-08 22:07:49 +00:00
Owner

The mentionedUsers query was being run on every post, regardless of
whether a mention was in it or not.

This resulted in an SQL query ending in WHERE userId IN () which is
not allowed in PostgreSQL.

Reference: #132
Changelog: Fixed

The mentionedUsers query was being run on every post, regardless of whether a mention was in it or not. This resulted in an SQL query ending in `WHERE userId IN ()` which is not allowed in PostgreSQL. Reference: https://akkoma.dev/FoundKeyGang/FoundKey/issues/132 Changelog: Fixed
norm added 1 commit 2022-09-08 20:17:57 +00:00
backend: move mentionedUsers query to mention handler
Some checks failed
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed
19e29c3465
The mentionedUsers query was being run on every post, regardless of
whether a mention was in it or not.

This resulted in an SQL query ending in `WHERE userId IN ()` which is
not allowed in PostgreSQL.

Reference: #132
Changelog: Fixed
Author
Owner

(Not adding a fixes line since I'm not sure if it's really fixed, but it does seem to resolve the issue on my local testing environment)

(Not adding a `fixes` line since I'm not sure if it's really fixed, but it does seem to resolve the issue on my local testing environment)
norm force-pushed fix/backend-toHtml-mentionedUsers from 759cb49976 to 199622b415 2022-09-08 21:47:44 +00:00 Compare
Owner

I think 199622b415 should fix the problem at hand here.

If only I knew a guy that read the contributing guide recently and should have spotted this problem earlier... ah right, 🥴 it's me!

I think 199622b41548110a2dee84983b93fe68388b20b8 should fix the problem at hand here. <small>If only I knew a guy that read the [contributing guide](https://akkoma.dev/FoundKeyGang/FoundKey/src/branch/main/CONTRIBUTING.md#empty-array-handling-in-typeorm-findoptions) recently and should have spotted this problem earlier... ah right, 🥴 it's me!</small>
Author
Owner

Yeah. There's some weird errors relating to types, but I think I'll leave that for a second PR.

Yeah. There's some weird errors relating to types, but I think I'll leave that for a second PR.
norm merged commit f50b31b847 into main 2022-09-08 22:07:49 +00:00
norm deleted branch fix/backend-toHtml-mentionedUsers 2022-09-08 22:07:49 +00:00
norm referenced this pull request from a commit 2022-09-10 00:58:12 +00:00
norm referenced this pull request from a commit 2022-09-10 01:21:33 +00:00
norm referenced this pull request from a commit 2022-09-11 18:29:47 +00:00
norm referenced this pull request from a commit 2022-09-12 20:30:38 +00:00
norm referenced this pull request from a commit 2022-09-12 20:38:28 +00:00
norm referenced this pull request from a commit 2022-09-13 15:20:06 +00:00
norm referenced this pull request from a commit 2022-09-13 15:20:27 +00:00
Sign in to join this conversation.
No reviewers
No labels
feature
fix
upkeep
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: FoundKeyGang/FoundKey#134
No description provided.