Skip to content

Conversation

@VelikovPetar
Copy link
Contributor

@VelikovPetar VelikovPetar commented Dec 1, 2025

🎯 Goal

Implements fixes for StrictMode violations (Read/Write disk on main thread) originating from the attachments picker.
Resolves: https://linear.app/stream/issue/AND-938/fix-strictmode-violations-in-attachmentspicker

🛠 Implementation details

  • Introduce new AttachmentsProcessingViewModel which defers the StorageHelperWrapper operations to a background thread.
  • Use the new view model in AttachmentsPickerFilesTabFactory, AttachmentsPickerImagesTabFactory and in AttachmentsPickerSystemTabFactory
  • Add similar async operations in the AttachmentsPickerViewModel
  • Rework the AttachmentsPicker composable to use the new asynchronous methods

🎨 UI Changes

NA

🧪 Testing

  1. Open attachment picker
  2. Select from the Images or Files tab (or do the same with ChatTheme(useDefaultSystemMediaPicker = true))
  3. There should be no violations logged in the LogCat

@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.25 MB 5.25 MB 0.00 MB 🟢
stream-chat-android-offline 5.48 MB 5.48 MB 0.00 MB 🟢
stream-chat-android-ui-components 10.59 MB 10.59 MB 0.00 MB 🟢
stream-chat-android-compose 12.81 MB 12.82 MB 0.01 MB 🟢

@VelikovPetar VelikovPetar changed the title AttachmentsPickerSystemTabFactory strict mode. Fix StrictMode violations in the AttachmentsPicker Dec 2, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 4, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
43.6% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@VelikovPetar VelikovPetar marked this pull request as ready for review December 5, 2025 12:24
@VelikovPetar VelikovPetar requested a review from a team as a code owner December 5, 2025 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants