Skip to content

Commit

Permalink
Fix deleteSipDispatchRule and TransformCall.clone (#87)
Browse files Browse the repository at this point in the history
* Fix deleteSipDispatchRule and TransformCall.clone

* changeset

* Add spotlessCheck to CI
  • Loading branch information
davidliu authored Oct 8, 2024
1 parent 9d06d5b commit 669ebe8
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/giant-seals-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"server-sdk-kotlin": patch
---

Fix clone function for transformed calls
5 changes: 5 additions & 0 deletions .changeset/gorgeous-knives-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"server-sdk-kotlin": patch
---

Fix deleteSipDispatchRule
9 changes: 9 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Gradle clean
run: ./gradlew clean

- name: Spotless check
if: github.event_name == 'pull_request'
run: |
git fetch origin main --depth 1
./gradlew spotlessCheck
- name: Build with Gradle
run: ./gradlew assemble

Expand Down
4 changes: 1 addition & 3 deletions src/main/kotlin/io/livekit/server/SipService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package io.livekit.server

import com.google.protobuf.Empty
import livekit.LivekitSip
import retrofit2.Call
import retrofit2.http.Body
Expand Down Expand Up @@ -79,7 +78,7 @@ interface SipService {
): Call<LivekitSip.ListSIPDispatchRuleResponse>

@Headers("Content-Type: application/protobuf")
@POST("/twirp/livekit.SIP/CreateSIPDispatchRule")
@POST("/twirp/livekit.SIP/DeleteSIPDispatchRule")
fun deleteSipDispatchRule(
@Body request: LivekitSip.DeleteSIPDispatchRuleRequest,
@Header("Authorization") authorization: String
Expand All @@ -98,5 +97,4 @@ interface SipService {
@Body request: LivekitSip.TransferSIPParticipantRequest,
@Header("Authorization") authorization: String
): Call<Void?>

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import retrofit2.Response
internal class TransformCall<T, R>(private val sourceCall: Call<T>, private val transform: (T) -> R) :
Call<R> {
override fun clone(): Call<R> {
return TransformCall(sourceCall, transform)
return TransformCall(sourceCall.clone(), transform)
}

override fun execute(): Response<R> {
Expand Down

0 comments on commit 669ebe8

Please sign in to comment.