Skip to content

Commit f75a72e

Browse files
author
Oleksandr Dzhychko
authored
Merge pull request #945 from modelix/fix/typo-in-setClientProvideUserId
fix(model-client): fix typo in setClientProvideUserId
2 parents 2f031d4 + e88f205 commit f75a72e

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

model-client/src/commonMain/kotlin/org/modelix/model/client2/ModelClientV2.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,23 @@ class ModelClientV2(
125125
}.bodyAsText()
126126
}
127127

128+
/**
129+
* Version of [setClientProvidedUserId] with typo.
130+
*/
131+
@Deprecated("Use setClientProvidedUserId, without a typo.", ReplaceWith("setClientProvidedUserId(userId)"))
132+
fun setClientProvideUserId(userId: String?) {
133+
clientProvidedUserId = userId
134+
}
135+
128136
/**
129137
* Set or remove the client provided user ID.
130138
*
131139
* When the used ID is removed by passing null, [[getUserId]] might return the [[serverProvidedUserId]].
132140
*
133141
* @param userId A new user ID, or null to remove the old one.
134142
*/
135-
fun setClientProvideUserId(userId: String?) {
136-
clientProvidedUserId = userId
143+
fun setClientProvidedUserId(userId: String?) {
144+
setClientProvideUserId(userId)
137145
}
138146

139147
override fun getClientId(): Int = clientId

model-client/src/jsMain/kotlin/org/modelix/model/client2/ClientJS.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ interface ClientJS {
152152
internal class ClientJSImpl(private val modelClient: ModelClientV2) : ClientJS {
153153

154154
override fun setClientProvidedUserId(userId: String) {
155-
modelClient.setClientProvideUserId(userId)
155+
modelClient.setClientProvidedUserId(userId)
156156
}
157157

158158
override fun initRepository(repositoryId: String, useRoleIds: Boolean): Promise<Unit> {

model-server/src/test/kotlin/org/modelix/model/server/ModelClientV2Test.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class ModelClientV2Test {
123123
fun `user id can be provided to client after creation`() = runTest {
124124
val modelClient = createModelClient()
125125
val userId = "a_user_id"
126-
modelClient.setClientProvideUserId(userId)
126+
modelClient.setClientProvidedUserId(userId)
127127

128128
assertEquals(userId, modelClient.getUserId())
129129
}
@@ -141,7 +141,7 @@ class ModelClientV2Test {
141141
modelClient.init()
142142

143143
assertEquals(userId, modelClient.getUserId())
144-
modelClient.setClientProvideUserId(null)
144+
modelClient.setClientProvidedUserId(null)
145145

146146
assertEquals("[email protected]", modelClient.getUserId())
147147
}

0 commit comments

Comments
 (0)