Skip to content

Commit 2cae8f6

Browse files
authored
fix: version update (#247)
1 parent f462564 commit 2cae8f6

File tree

4 files changed

+24
-19
lines changed

4 files changed

+24
-19
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
99

10-
## [7.3.0]
10+
## [8.0.0]
1111

1212
- Adds tables and queries for Bulk Import
1313
- Optimize getUserIdMappingWithEitherSuperTokensUserIdOrExternalUserId query

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
id 'java-library'
33
}
44

5-
version = "7.3.0"
5+
version = "8.0.0"
66

77
repositories {
88
mavenCentral()

pluginInterfaceSupported.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"_comment": "contains a list of plugin interfaces branch names that this core supports",
33
"versions": [
4-
"6.4"
4+
"7.0"
55
]
66
}

src/main/java/io/supertokens/storage/postgresql/queries/SessionQueries.java

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -151,31 +151,36 @@ public static SessionInfo getSessionInfo_Transaction(Start start, Connection con
151151
return null;
152152
}
153153

154-
QUERY = "SELECT external_user_id " +
154+
QUERY = "SELECT external_user_id, 0 as o " +
155155
"FROM " + getConfig(start).getUserIdMappingTable() + " um2 " +
156156
"WHERE um2.app_id = ? AND um2.supertokens_user_id IN (" +
157-
"SELECT primary_or_recipe_user_id " +
157+
"SELECT primary_or_recipe_user_id " +
158158
"FROM " + getConfig(start).getUsersTable() + " " +
159159
"WHERE app_id = ? AND user_id IN (" +
160-
"SELECT um1.supertokens_user_id as user_id " +
161-
"FROM " + getConfig(start).getUserIdMappingTable() + " um1 " +
162-
"WHERE um1.app_id = ? AND um1.external_user_id = ? " +
163-
"UNION ALL " +
164-
"SELECT ? " +
165-
"LIMIT 1" +
160+
"SELECT user_id FROM (" +
161+
"SELECT um1.supertokens_user_id as user_id, 0 as o1 " +
162+
"FROM " + getConfig(start).getUserIdMappingTable() + " um1 " +
163+
"WHERE um1.app_id = ? AND um1.external_user_id = ? " +
164+
"UNION " +
165+
"SELECT ?, 1 as o1 " +
166+
"ORDER BY o1 ASC " +
167+
") uid1" +
166168
")" +
167169
") " +
168-
"UNION ALL " +
169-
"SELECT primary_or_recipe_user_id " +
170+
"UNION " +
171+
"SELECT primary_or_recipe_user_id, 1 as o " +
170172
"FROM " + getConfig(start).getUsersTable() + " " +
171173
"WHERE app_id = ? AND user_id IN (" +
172-
"SELECT um1.supertokens_user_id as user_id " +
173-
"FROM " + getConfig(start).getUserIdMappingTable() + " um1 " +
174-
"WHERE um1.app_id = ? AND um1.external_user_id = ? " +
175-
"UNION ALL " +
176-
"SELECT ? " +
177-
"LIMIT 1" +
174+
"SELECT user_ID FROM (" +
175+
"SELECT um1.supertokens_user_id as user_id, 0 as o2 " +
176+
"FROM " + getConfig(start).getUserIdMappingTable() + " um1 " +
177+
"WHERE um1.app_id = ? AND um1.external_user_id = ? " +
178+
"UNION " +
179+
"SELECT ?, 1 as o2 " +
180+
"ORDER BY o2 ASC " +
181+
") uid2 " +
178182
") " +
183+
"ORDER BY o ASC " +
179184
"LIMIT 1";
180185

181186
String finalUserId = execute(con, QUERY, pst -> {

0 commit comments

Comments
 (0)