You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c062f70
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: stream-chat-android-client/src/main/java/io/getstream/chat/android/client/attachment/AttachmentUploader.kt
+13-5Lines changed: 13 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,8 @@ public class AttachmentUploader(private val client: ChatClient = ChatClient.inst
82
82
} else {
83
83
originalFile.name
84
84
}
85
+
// Read before uploading, as a custom FileUploader may delete the file once it's uploaded.
Copy file name to clipboardExpand all lines: stream-chat-android-client/src/test/java/io/getstream/chat/android/client/attachment/AttachmentUploaderTests.kt
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -117,6 +117,24 @@ internal class AttachmentUploaderTests {
117
117
}
118
118
}
119
119
120
+
@Test
121
+
fun`Should keep the size of an uploaded file that the uploader deletes`() = runTest {
122
+
val transformedFile =File.createTempFile("transformed", ".jpg").apply { writeBytes(ByteArray(1234)) }
123
+
val attachment =Attachment(type ="image", upload =File("photo.jpg"))
124
+
val clientMock = mockClientWithIdentityTransformer()
0 commit comments