Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 75aebd6

Browse filesBrowse files
committed
fix: sqlite syntax inconsistency
The SQL statement for creating a group uses syntax that only works under sqlite. This was caused by introducing anomaly detection when a user creates a large number of groups in quick succession.
1 parent 4647e2d commit 75aebd6
Copy full SHA for 75aebd6

File tree

1 file changed

+5
-2
lines changed
Filter options

1 file changed

+5
-2
lines changed

‎src/backend/src/services/auth/GroupService.js

Copy file name to clipboardExpand all lines: src/backend/src/services/auth/GroupService.js
+5-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,11 @@ class GroupService extends BaseService {
105105

106106
const [{ n_groups }] = await this.db.read(
107107
"SELECT COUNT(*) AS n_groups FROM `group` WHERE " +
108-
"owner_user_id=? AND " +
109-
"created_at >= datetime('now', '-1 hour')",
108+
"owner_user_id=? AND created_at >= " +
109+
this.db.case({
110+
sqlite: "datetime('now', '-1 hour')",
111+
otherwise: "NOW() - INTERVAL 1 HOUR"
112+
}),
110113
[owner_user_id]
111114
);
112115

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.