Status Update
Comments
br...@gmail.com <br...@gmail.com> #2
filterSync is eventually called within Flow<PagingData>.map, so I believe it runs in the collector's context, unless .flowOn
is called, but I may be incorrect here. I think it would be worthwhile to add a param to allow control over where it gets dispatched (including parallel executor API, since Java users won't normally use Coroutines directly), but maybe *Sync is a bad name if we do that.
It seems like the ideal API would be something like PagingData.map(executor, transform)
, and we could even deprecate the sync versions with a default arg / overload since their only purpose was to allow java callers to call into the suspending transforms.
Happy to take a PR for this change and to talk it through in more detail if you're interested in taking it on! Maybe we could sketch out what the API should be in a shared doc?
At the very least this bug definitely points to some holes in the sync transform APIs and I'm happy to slot some time for this bug if you were only interested in making small doc changes (totally understandable).
ak...@google.com <ak...@google.com> #3
Thanks for the information.
Taking in into account, I think it'd be best to have filter
, map
, flatMap
and their Sync
suffixed variants run on Dispatchers.Default
by default, since it's very very likely that we get CPU bound operations there, such as searching for filtering, allocating to create instances of other types from the input data…
Regarding the name of the Java API… I agree a little that "*Sync is a bad name", and I think Blocking
would be more accurate on the Kotlin side (while keeping the non suffixed @JvmName
for Java callers). That is related to the issue where I ask to discourage or prevent use of the API for Java callers in Kotlin code:
Maybe we could sketch out what the API should be in a shared doc?
Yes we can! You can send it here, or we can also chat on ASG or
Since it's not what I expected (not run on Dispatchers.Default
, I think it's best to talk more about the design before considering a PR.
br...@gmail.com <br...@gmail.com> #4
Thanks - I sent you a message and started a doc, these are definitely some valid concerns!
Description
What
User experience
What type of Android issue is this?
User Interface
What steps would let us observe this issue?
What was the effect of this issue on your device usage, such as lost time or work?
Moderate
When
Time and frequency
Time when bug report was triggered: Apr 1, 2025 12:39 AM GMT+01:00
How often has this happened?
Every time
Where
Component
Originating component: <not visible> (1684638)
Build and device data
- Build Number: google/akita_beta/akita:16/BP22.250221.013/13218340:user/release-keys
(Note: It is the build when sending this report. For exact build reference, please see the attached bugreport.)
Debugging information
Serviços do Google Play
com.google.android.gms
Version 251036035 (25.10.36 (260400-739992411))
System App (Updated)
Android System WebView
com.google.android.webview
Version 699813533 (134.0.6998.135)
System App (Updated)
Network operator: MEO
SIM operator: MEO
Filed by Android Beta Feedback. Version (Updated): 2.46-betterbug.external_20241023_RC01 (DOGFOOD)https://developer.android.com/preview/feedback#feedback-app .
To learn more about our feedback process, please visit