docs+test(app): correct okhttp version comments; harden throttle test assertions
- UploadPutExecutor.kt / build.gradle.kts:OkHttp 版本注释改为实情——声明 4.12.0,Gradle 冲突仲裁实际解析 5.2.1(fluwx 传递依赖胜出) - UploadPutExecutorTest.kt:节流测试补 isNotEmpty 守护与 size>=2 断言(堵住过度节流只报终值的盲区) Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -65,7 +65,8 @@ kotlin {
|
||||
|
||||
dependencies {
|
||||
// P3 Task 7 后台上传桥接:WorkManager(expedited + dataSync 前台服务)
|
||||
// + OkHttp 直传 presign PUT(独立 4.12,与 Flutter 引擎无耦合)。
|
||||
// + OkHttp 直传 presign PUT(声明 4.12.0,Gradle 冲突仲裁实际解析
|
||||
// 5.2.1——fluwx 传递依赖胜出;独立实例、与 Flutter 引擎无耦合不变)。
|
||||
implementation("androidx.work:work-runtime-ktx:2.10.0")
|
||||
implementation("androidx.core:core-ktx:1.15.0")
|
||||
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
||||
|
||||
+3
-1
@@ -40,7 +40,9 @@ sealed class PutOutcome {
|
||||
* 发送,二者不重复注入);
|
||||
* - 进度:写 body 驱动 [onProgress](已发字节/总字节,IO 线程回调;
|
||||
* 256KB 步长节流,末块必报 sent==total);
|
||||
* - OkHttp 独立实例(4.12,与 Flutter 引擎无耦合;连接失败内置静默重试)。
|
||||
* - OkHttp 独立实例(声明 4.12.0,Gradle 冲突仲裁实际解析 5.2.1——
|
||||
* fluwx 传递依赖胜出;独立实例、与 Flutter 引擎无耦合的性质不变,
|
||||
* 连接失败内置静默重试)。
|
||||
*/
|
||||
object UploadPutExecutor {
|
||||
|
||||
|
||||
+3
@@ -164,6 +164,9 @@ class UploadPutExecutorTest {
|
||||
filePath = bigFile.absolutePath,
|
||||
client = client,
|
||||
) { sent, total -> samples.add(sent to total) }
|
||||
assertTrue(samples.isNotEmpty())
|
||||
// 至少一次 ≥256KB 步长回调 + 末块(防过度节流只报终值的盲区)。
|
||||
assertTrue(samples.size >= 2)
|
||||
// 末块必报:sent == total。
|
||||
assertEquals(bigFile.length(), samples.last().first)
|
||||
assertEquals(bigFile.length(), samples.last().second)
|
||||
|
||||
Reference in New Issue
Block a user