Fix conversation home reachability and Android timeout

This commit is contained in:
kris
2026-04-05 14:16:18 +08:00
parent 08a746c3bf
commit 272698234d
4 changed files with 51 additions and 5 deletions

View File

@@ -90,7 +90,13 @@ public class BossApiClient {
}
public ApiResponse getConversationHome() throws IOException, JSONException {
return requestWithRestore("GET", "/api/v1/conversations/home", null);
return requestWithRestoreRaw(
"GET",
"/api/v1/conversations/home",
null,
DEFAULT_CONNECT_TIMEOUT_MS,
CONVERSATIONS_READ_TIMEOUT_MS
);
}
public ApiResponse getConversationFolder(String folderKey) throws IOException, JSONException {

View File

@@ -53,6 +53,20 @@ public class BossApiClientDispatchPlansTest {
assertEquals(30000, connection.readTimeoutValue);
}
@Test
public void getConversationHomeUsesExtendedReadTimeoutForSlowHomeFeed() throws Exception {
RecordingConnection connection = new RecordingConnection(new URL("https://boss.hyzq.net/api/v1/conversations/home"));
RecordingBossApiClient apiClient = new RecordingBossApiClient(connection);
BossApiClient.ApiResponse response = apiClient.getConversationHome();
assertEquals(200, response.statusCode);
assertEquals("/api/v1/conversations/home", apiClient.lastPath);
assertEquals("GET", connection.requestMethodValue);
assertEquals(12000, connection.connectTimeoutValue);
assertEquals(30000, connection.readTimeoutValue);
}
@Test
public void confirmDispatchPlanWritesApprovedTargetProjectIds() throws Exception {
RecordingConnection connection = new RecordingConnection(new URL("https://boss.hyzq.net/api/v1/projects/p1/dispatch-plans/plan-1/confirm"));
@@ -65,7 +79,10 @@ public class BossApiClientDispatchPlansTest {
assertEquals("POST", connection.requestMethodValue);
assertEquals(12000, connection.connectTimeoutValue);
assertEquals(65000, connection.readTimeoutValue);
assertEquals("{\"approvedTargetProjectIds\":[\"target-1\",\"target-2\"]}", connection.requestBody());
assertEquals(
"{\"approvedTargetProjectIds\":[\"target-1\",\"target-2\"],\"rememberLightReminder\":false}",
connection.requestBody()
);
}
@Test