fix: implement robust PHONE device fallback in handleDashboardAction for local development

This commit is contained in:
2026-07-04 15:51:40 -06:00
parent 181e9b53bd
commit 6aab0b2ac7
2 changed files with 158 additions and 2 deletions

View File

@@ -166,10 +166,11 @@ class MeatbagClient(
suspend fun respond(response: ApprovalResponse): Boolean {
return try {
log("Sending response to POST http://$host:$port/api/respond : ${response.toJson()}")
val responseWithDevice = response.copy(deviceId = deviceId)
log("Sending response to POST http://$host:$port/api/respond : ${responseWithDevice.toJson()}")
val httpResponse = client.post("http://$host:$port/api/respond") {
contentType(ContentType.Application.Json)
setBody(response)
setBody(responseWithDevice)
}
if (httpResponse.status.isSuccess()) {
log("Response submitted successfully! Server returned 200 OK", LogType.SUCCESS)