Skip to content

Commit 11fcee1

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix-loading-extension-from-jar
2 parents 2101f0e + 3ea01ff commit 11fcee1

File tree

8 files changed

+7
-11
lines changed

8 files changed

+7
-11
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 1.0.0-BETA32
44

55
* Added `onChange` method to the PowerSync client. This allows for observing table changes.
6+
* Removed unnecessary `User-Id` header from internal PowerSync service requests.
67
* Fix loading native PowerSync extension for Java targets.
78

89
## 1.0.0-BETA31

README.md

-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ Current limitations:
4747

4848
- Integration with SQLDelight schema and API generation (ORM) is not yet supported.
4949

50-
Future work/ideas:
51-
- Attachments helper package.
52-
5350
## Installation
5451

5552
Add the PowerSync Kotlin Multiplatform SDK to your project by adding the following to your `build.gradle.kts` file:

connectors/supabase/src/commonMain/kotlin/com/powersync/connector/supabase/SupabaseConnector.kt

-2
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,9 @@ public class SupabaseConnector(
164164

165165
check(session.user != null) { "No user data" }
166166

167-
// userId is for debugging purposes only
168167
PowerSyncCredentials(
169168
endpoint = powerSyncEndpoint,
170169
token = session.accessToken, // Use the access token to authenticate against PowerSync
171-
userId = session.user!!.id,
172170
)
173171
}
174172

core/src/commonIntegrationTest/kotlin/com/powersync/testutils/TestUtils.kt

-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ internal class ActiveDatabaseTest(
100100
everySuspend { getCredentialsCached() } returns
101101
PowerSyncCredentials(
102102
token = "test-token",
103-
userId = "test-user",
104103
endpoint = "https://test.com",
105104
)
106105

core/src/commonMain/kotlin/com/powersync/connectors/PowerSyncCredentials.kt

+6-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ public data class PowerSyncCredentials(
1919
/**
2020
* User ID.
2121
*/
22-
@SerialName("user_id") val userId: String?,
22+
@Deprecated(
23+
message = "This property is no longer used and should be removed.",
24+
level = DeprecationLevel.WARNING,
25+
)
26+
@SerialName("user_id")
27+
val userId: String? = null,
2328
) {
2429
override fun toString(): String = "PowerSyncCredentials<endpoint: $endpoint userId: $userId>"
2530

core/src/commonMain/kotlin/com/powersync/sync/SyncStream.kt

-2
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ internal class SyncStream(
174174
contentType(ContentType.Application.Json)
175175
headers {
176176
append(HttpHeaders.Authorization, "Token ${credentials.token}")
177-
append("User-Id", credentials.userId ?: "")
178177
}
179178
}
180179
if (response.status.value == 401) {
@@ -202,7 +201,6 @@ internal class SyncStream(
202201
contentType(ContentType.Application.Json)
203202
headers {
204203
append(HttpHeaders.Authorization, "Token ${credentials.token}")
205-
append("User-Id", credentials.userId ?: "")
206204
}
207205
timeout { socketTimeoutMillis = Long.MAX_VALUE }
208206
setBody(bodyJson)

core/src/commonTest/kotlin/com/powersync/TestConnector.kt

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ class TestConnector : PowerSyncBackendConnector() {
77
var fetchCredentialsCallback: suspend () -> PowerSyncCredentials? = {
88
PowerSyncCredentials(
99
token = "test-token",
10-
userId = "test-user",
1110
endpoint = "https://test.com",
1211
)
1312
}

core/src/commonTest/kotlin/com/powersync/sync/SyncStreamTest.kt

-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ class SyncStreamTest {
8686
everySuspend { getCredentialsCached() } returns
8787
PowerSyncCredentials(
8888
token = "test-token",
89-
userId = "test-user",
9089
endpoint = "https://test.com",
9190
)
9291
}

0 commit comments

Comments
 (0)