Status Update
Comments
ro...@gmail.com <ro...@gmail.com> #2
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
ro...@gmail.com <ro...@gmail.com> #3
du...@google.com <du...@google.com>
du...@google.com <du...@google.com> #4
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
ro...@gmail.com <ro...@gmail.com> #5
be ready until first monday.
BTW I have a debug aab of my main project where this error occures, it is
not stable at all... Give me a hint (email) if you want that. I may give
you a link to my github repo of the project or I can zip you my project as
it is.
RG
ons. 1. jul. 2020, 22:13 skrev <buganizer-system@google.com>:
du...@google.com <du...@google.com> #6
ro...@gmail.com <ro...@gmail.com> #7
I am not too familiar using github, but I think I've added you as a collaborator to my project "EmptyFuel".
In the other hand I'll zip my project and send it to you.
RG
ro...@gmail.com <ro...@gmail.com> #8
Here's an additional error log:
2020-07-01 23:08:50.853 27099-27099/? E/.android.gms.u: Unknown bits set in runtime_flags: 0x200000
2020-07-01 23:08:50.859 27099-27099/? E/.android.gms.u: Not starting debugger since process cannot load the jdwp agent.
2020-07-01 23:08:51.085 14053-25013/? E/SQLiteDatabase: Error inserting flex_time=1000 extras={"fetchReason":{"15":0},"fetchPackage":{"com.google.android.gms.chimera":4}} job_id=-1 period=2000 source=16 requires_charging=0 target_class=com.google.android.gms.phenotype.service.sync.PhenotypeConfigurator user_id=0 target_package=com.google.android.gms tag=PhenotypeSyncImmediately task_type=0 required_idleness_state=0 service_kind=0 source_version=202612000 persistence_level=1 required_network_type=0 runtime=1593637731082 retry_strategy={"maximum_backoff_seconds":{"3600":0},"initial_backoff_seconds":{"30":0},"retry_policy":{"0":0}} last_runtime=0
android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: pending_ops.tag, pending_ops.target_class, pending_ops.target_package, pending_ops.user_id (code 2067 SQLITE_CONSTRAINT_UNIQUE)
at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:938)
at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790)
at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:88)
at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1701)
at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1570)
at aoqj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):175)
at aopj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):162)
at aopj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):22)
at aopj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):157)
at aolt.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):9)
at qlu.b(:com.google.android.gms@202612050@20.26.12 (150800-317812943):12)
at qlu.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):7)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at qrp.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):0)
at java.lang.Thread.run(Thread.java:923)
2020-07-01 23:08:51.474 14097-21418/? E/SQLiteCastStore: Skip saving CastDeviceInfo: "Nearby device" (__cast_nearby___V_7268191a-9f0d-474c-adca-708ad60ba6c3)
2020-07-01 23:08:51.745 566-599/? E/libprocessgroup: AddTidToCgroup failed to write '27134'; fd=61: Invalid argument
2020-07-01 23:08:51.746 566-599/? E/libprocessgroup: Failed to add task into cgroup
2020-07-01 23:09:00.716 27160-27160/? E/d.configupdate: Unknown bits set in runtime_flags: 0x200000
2020-07-01 23:09:00.764 27160-27160/? E/d.configupdate: Not starting debugger since process cannot load the jdwp agent.
2020-07-01 23:09:07.305 14097-21418/? E/DowngradeHelper: isModuleDowngradeRequired false
2020-07-01 23:09:07.618 14097-27200/? E/PhenotypeRegOp: Attempting to overwrite config package for com.google.android.gms.games [CONTEXT service_id=231 ]
2020-07-01 23:09:07.620 14097-27200/? E/PhenotypeRegOp: Attempting to overwrite config package for com.google.android.gms.mobile_data_plan [CONTEXT service_id=231 ]
2020-07-01 23:09:07.620 14097-27200/? E/PhenotypeRegOp: Attempting to overwrite config package for com.google.android.gms.nearby [CONTEXT service_id=231 ]
2020-07-01 23:09:07.621 14097-27200/? E/PhenotypeRegOp: Attempting to overwrite config package for com.google.android.gms.signin [CONTEXT service_id=231 ]
2020-07-01 23:09:07.622 14097-27200/? E/PhenotypeRegOp: Attempting to overwrite config package for com.google.android.gms.udc [CONTEXT service_id=231 ]
2020-07-01 23:09:08.088 14053-26880/? E/SQLiteDatabase: Error inserting flex_time=1000 extras={"fetchReason":{"8":0},"fetchPackage":{"com.google.android.gms":4}} job_id=-1 period=2000 source=16 requires_charging=0 target_class=com.google.android.gms.phenotype.service.sync.PhenotypeConfigurator user_id=0 target_package=com.google.android.gms tag=PhenotypeSyncImmediately task_type=0 required_idleness_state=0 service_kind=0 source_version=202612000 persistence_level=1 required_network_type=0 runtime=1593637748086 retry_strategy={"maximum_backoff_seconds":{"3600":0},"initial_backoff_seconds":{"30":0},"retry_policy":{"0":0}} last_runtime=0
android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: pending_ops.tag, pending_ops.target_class, pending_ops.target_package, pending_ops.user_id (code 2067 SQLITE_CONSTRAINT_UNIQUE)
at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:938)
at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790)
at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:88)
at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1701)
at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1570)
at aoqj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):175)
at aopj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):162)
at aopj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):22)
at aopj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):157)
at aolt.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):9)
at qlu.b(:com.google.android.gms@202612050@20.26.12 (150800-317812943):12)
at qlu.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):7)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at qrp.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):0)
at java.lang.Thread.run(Thread.java:923)
2020-07-01 23:09:08.699 393-393/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
2020-07-01 23:09:45.483 384-384/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2020-07-01 23:10:08.749 393-393/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
2020-07-01 23:10:45.502 384-384/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2020-07-01 23:11:08.755 393-393/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
2020-07-01 23:11:45.565 384-384/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2020-07-01 23:12:08.761 393-393/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
2020-07-01 23:12:45.573 384-384/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2020-07-01 23:13:08.768 393-393/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
2020-07-01 23:13:45.583 384-384/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2020-07-01 23:13:47.993 566-583/? E/JobScheduler.Background: App com.google.android.gms became active but still in NEVER bucket
2020-07-01 23:13:51.216 14097-5513/? E/SQLiteCastStore: Skip saving CastDeviceInfo: "Nearby device" (__cast_nearby___V_7268191a-9f0d-474c-adca-708ad60ba6c3)
2020-07-01 23:14:08.772 393-393/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
2020-07-01 23:14:45.584 384-384/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2020-07-01 23:15:08.860 393-393/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
2020-07-01 23:15:47.345 384-384/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2020-07-01 23:16:08.863 393-393/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
2020-07-01 23:16:47.395 384-384/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2020-07-01 23:16:51.609 14053-14260/? E/WakeLock: GCM_READ ** IS FORCE-RELEASED ON TIMEOUT **
2020-07-01 23:16:53.343 27270-27270/? E/ogle.android.g: Unknown bits set in runtime_flags: 0x200000
2020-07-01 23:16:53.438 27270-27270/? E/ogle.android.g: Not starting debugger since process cannot load the jdwp agent.
2020-07-01 23:16:56.259 566-583/? E/JobScheduler.Background: App com.google.android.gms became active but still in NEVER bucket
2020-07-01 23:16:59.802 27270-27270/? E/apiw: Sync is not initialized yet
2020-07-01 23:17:07.784 27415-27415/? E/d.process.acor: Unknown bits set in runtime_flags: 0x200000
2020-07-01 23:17:07.808 27415-27415/? E/d.process.acor: Not starting debugger since process cannot load the jdwp agent.
2020-07-01 23:17:08.923 393-393/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
2020-07-01 23:17:30.573 566-579/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:30.730 566-579/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:30.743 566-579/? E/NotificationService: Package has already posted or enqueued 26 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:30.780 566-1229/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:30.811 566-1229/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:30.828 566-579/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:30.877 566-579/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:30.909 566-1229/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:30.932 566-2595/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:30.944 566-2595/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:30.957 566-4183/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:30.970 566-579/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:30.984 566-4183/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:30.997 566-579/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:31.017 566-579/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:31.035 566-4183/? E/NotificationService: Package has already posted or enqueued 26 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:31.048 566-579/? E/NotificationService: Package has already posted or enqueued 26 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:31.071 566-2595/? E/NotificationService: Package has already posted or enqueued 26 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:31.085 566-2595/? E/NotificationService: Package has already posted or enqueued 26 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:31.104 566-2595/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:31.157 566-4183/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:31.262 566-4183/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:31.297 566-2595/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:31.362 566-2595/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:31.409 566-4183/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:31.430 566-4183/? E/NotificationService: Package has already posted or enqueued 25 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:31.449 566-4183/? E/NotificationService: Package has already posted or enqueued 26 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:17:47.407 384-384/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2020-07-01 23:17:58.380 27270-27467/? E/afzm: Interactive Ads jobs: did not expect this future to ever resolve
2020-07-01 23:17:31.495 566-4183/? E/NotificationService: Package has already posted or enqueued 26 notifications. Not showing more. package=com.google.android.gm
2020-07-01 23:18:08.991 393-393/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
2020-07-01 23:18:47.414 384-384/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2020-07-01 23:18:51.221 14097-5513/? E/SQLiteCastStore: Skip saving CastDeviceInfo: "Nearby device" (__cast_nearby___V_7268191a-9f0d-474c-adca-708ad60ba6c3)
2020-07-01 23:19:09.009 393-393/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
2020-07-01 23:19:47.527 384-384/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2020-07-01 23:20:09.013 393-393/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
2020-07-01 23:20:30.362 14053-27499/? E/WorkSourceUtil: Could not find package: com.google.android.gms.westworld
2020-07-01 23:20:47.553 384-384/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2020-07-01 23:21:09.021 393-393/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
2020-07-01 23:21:32.091 566-583/? E/JobScheduler.Background: App com.google.android.gms became active but still in NEVER bucket
2020-07-01 23:21:32.874 430-624/? E/installd: Couldn't opendir /data/app/vmdl1146787658.tmp: No such file or directory
2020-07-01 23:21:32.875 430-624/? E/installd: Failed to delete /data/app/vmdl1146787658.tmp: No such file or directory
2020-07-01 23:21:33.389 431-667/? E/IPCThreadState: binder thread pool (1 threads) starved for 563 ms
2020-07-01 23:21:34.441 1089-1855/? E/ActivityThread: Failed to find provider info for com.google.android.apps.wellbeing.api
2020-07-01 23:21:35.069 27571-27571/? E/ndroid.keychai: Unknown bits set in runtime_flags: 0x200000
2020-07-01 23:21:35.082 27571-27571/? E/ndroid.keychai: Not starting debugger since process cannot load the jdwp agent.
2020-07-01 23:21:40.032 1089-1855/? E/ActivityThread: Failed to find provider info for com.google.android.apps.wellbeing.api
2020-07-01 23:21:40.926 27602-27602/? E/ssioncontrolle: Unknown bits set in runtime_flags: 0x200000
2020-07-01 23:21:41.010 27602-27602/? E/ssioncontrolle: Not starting debugger since process cannot load the jdwp agent.
2020-07-01 23:21:42.576 1565-1565/? E/SearchServiceStarter: Task 174 failed or timed out. Client 6884536120926570 disconnecting from SearchService!
java.util.concurrent.CancellationException: Task was cancelled.
at com.google.common.v.a.d.a(SourceFile:128)
at com.google.common.v.a.d.get(SourceFile:78)
at com.google.common.v.a.dq.a(SourceFile:1)
at com.google.common.v.a.bu.a(SourceFile:6)
at com.google.common.v.a.bq.run(SourceFile:4)
at com.google.android.apps.gsa.shared.util.c.a.as.run(SourceFile:1)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
2020-07-01 23:21:43.031 1565-1565/? E/SearchServiceStarter: Task 174 failed or timed out. Client 6884536120926572 disconnecting from SearchService!
java.util.concurrent.CancellationException: Task was cancelled.
at com.google.common.v.a.d.a(SourceFile:128)
at com.google.common.v.a.d.get(SourceFile:78)
at com.google.common.v.a.dq.a(SourceFile:1)
at com.google.common.v.a.bu.a(SourceFile:6)
at com.google.common.v.a.bq.run(SourceFile:4)
at com.google.android.apps.gsa.shared.util.c.a.as.run(SourceFile:1)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
2020-07-01 23:21:43.645 566-580/? E/system_server: Invalid class loader spec: =UnsupportedClassLoaderContext=
2020-07-01 23:21:43.645 566-580/? E/PackageDexUsage: Unsupported context?
2020-07-01 23:21:47.857 384-384/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2020-07-01 23:21:55.074 1089-1855/? E/ActivityThread: Failed to find provider info for com.google.android.apps.wellbeing.api
2020-07-01 23:21:56.201 27690-27690/? E/webview_servic: Unknown bits set in runtime_flags: 0x200000
2020-07-01 23:21:56.214 27690-27690/? E/webview_servic: Not starting debugger since process cannot load the jdwp agent.
2020-07-01 23:21:56.405 27710-27710/? E/ocessService0:: Unknown bits set in runtime_flags: 0x200000
2020-07-01 23:21:56.418 27710-27710/? E/ocessService0:: Not starting debugger since process cannot load the jdwp agent.
2020-07-01 23:22:02.025 566-599/? E/libprocessgroup: AddTidToCgroup failed to write '27861'; fd=61: Invalid argument
2020-07-01 23:22:02.025 566-599/? E/libprocessgroup: Failed to add task into cgroup
2020-07-01 23:22:03.393 566-653/? E/InputDispatcher: channel '2745025 Splash Screen no.rogo.emptyfuel (server)' ~ Channel is unrecoverably broken and will be disposed!
2020-07-01 23:22:03.608 27554-27554/no.rogo.emptyfuel E/StationListFragment: loadNativeAds: The prevous native ad failed to load with error 0.Attempt to load another.
2020-07-01 23:22:03.728 566-583/? E/JobScheduler.Background: App com.google.android.gms became active but still in NEVER bucket
2020-07-01 23:22:06.695 14053-27659/? E/chrs: *~*~*~ Channel {0} was not shutdown properly!!! ~*~*~*
Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true.
java.lang.RuntimeException: ManagedChannel allocation site
at chrr.<init>(:com.google.android.gms@202612050@20.26.12 (150800-317812943):3)
at chrs.<init>(:com.google.android.gms@202612050@20.26.12 (150800-317812943):2)
at chlk.b(:com.google.android.gms@202612050@20.26.12 (150800-317812943):21)
at qgl.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):23)
at qgl.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):30)
at bfiu.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):7)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at qlu.b(:com.google.android.gms@202612050@20.26.12 (150800-317812943):12)
at qlu.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):7)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at qrp.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):0)
at java.lang.Thread.run(Thread.java:923)
2020-07-01 23:22:06.733 14053-27659/? E/chrs: *~*~*~ Channel {0} was not shutdown properly!!! ~*~*~*
Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true.
java.lang.RuntimeException: ManagedChannel allocation site
at chrr.<init>(:com.google.android.gms@202612050@20.26.12 (150800-317812943):3)
at chrs.<init>(:com.google.android.gms@202612050@20.26.12 (150800-317812943):2)
at chlk.b(:com.google.android.gms@202612050@20.26.12 (150800-317812943):21)
at qgl.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):23)
at qgl.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):30)
at bfiu.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):7)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at qlu.b(:com.google.android.gms@202612050@20.26.12 (150800-317812943):12)
at qlu.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):7)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at qrp.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):0)
at java.lang.Thread.run(Thread.java:923)
2020-07-01 23:22:09.080 393-393/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
2020-07-01 23:22:10.373 14053-27659/? E/SQLiteDatabase: Error inserting flex_time=0 job_id=-1 period=2000 source=16 requires_charging=0 preferred_network_type=1 target_class=com.google.android.gms.measurement.PackageMeasurementTaskService user_id=0 target_package=com.google.android.gms tag=Measurement.PackageMeasurementTaskService.UPLOAD_TASK_TAG task_type=0 required_idleness_state=0 service_kind=0 source_version=202612000 persistence_level=1 preferred_charging_state=1 required_network_type=0 runtime=1593638530347 retry_strategy={"maximum_backoff_seconds":{"3600":0},"initial_backoff_seconds":{"30":0},"retry_policy":{"0":0}} last_runtime=0
android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: pending_ops.tag, pending_ops.target_class, pending_ops.target_package, pending_ops.user_id (code 2067 SQLITE_CONSTRAINT_UNIQUE)
at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:938)
at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790)
at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:88)
at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1701)
at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1570)
at aoqj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):175)
at aopj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):162)
at aopj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):22)
at aopj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):157)
at aolt.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):9)
at qlu.b(:com.google.android.gms@202612050@20.26.12 (150800-317812943):12)
at qlu.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):7)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at qrp.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):0)
at java.lang.Thread.run(Thread.java:923)
2020-07-01 23:22:10.461 14053-27477/? E/SQLiteDatabase: Error inserting flex_time=6000 job_id=-1 period=13000 source=16 requires_charging=0 preferred_network_type=1 target_class=com.google.android.gms.measurement.PackageMeasurementTaskService user_id=0 target_package=com.google.android.gms tag=Measurement.PackageMeasurementTaskService.UPLOAD_TASK_TAG task_type=0 required_idleness_state=0 service_kind=0 source_version=202612000 persistence_level=1 preferred_charging_state=1 required_network_type=0 runtime=1593638530457 retry_strategy={"maximum_backoff_seconds":{"3600":0},"initial_backoff_seconds":{"30":0},"retry_policy":{"0":0}} last_runtime=0
android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: pending_ops.tag, pending_ops.target_class, pending_ops.target_package, pending_ops.user_id (code 2067 SQLITE_CONSTRAINT_UNIQUE)
at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:938)
at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790)
at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:88)
at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1701)
at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1570)
at aoqj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):175)
at aopj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):162)
at aopj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):22)
at aopj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):157)
at aolt.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):9)
at qlu.b(:com.google.android.gms@202612050@20.26.12 (150800-317812943):12)
at qlu.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):7)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at qrp.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):0)
at java.lang.Thread.run(Thread.java:923)
2020-07-01 23:22:17.474 14053-27659/? E/SQLiteDatabase: Error inserting flex_time=3599000 job_id=-1 period=7200000 source=16 requires_charging=0 preferred_network_type=1 target_class=com.google.android.gms.measurement.PackageMeasurementTaskService user_id=0 target_package=com.google.android.gms tag=Measurement.PackageMeasurementTaskService.UPLOAD_TASK_TAG task_type=0 required_idleness_state=0 service_kind=0 source_version=202612000 persistence_level=1 preferred_charging_state=1 required_network_type=0 runtime=1593638537472 retry_strategy={"maximum_backoff_seconds":{"3600":0},"initial_backoff_seconds":{"30":0},"retry_policy":{"0":0}} last_runtime=0
android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: pending_ops.tag, pending_ops.target_class, pending_ops.target_package, pending_ops.user_id (code 2067 SQLITE_CONSTRAINT_UNIQUE)
at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:938)
at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790)
at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:88)
at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1701)
at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1570)
at aoqj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):175)
at aopj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):162)
at aopj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):22)
at aopj.a(:com.google.android.gms@202612050@20.26.12 (150800-317812943):157)
at aolt.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):9)
at qlu.b(:com.google.android.gms@202612050@20.26.12 (150800-317812943):12)
at qlu.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):7)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at qrp.run(:com.google.android.gms@202612050@20.26.12 (150800-317812943):0)
at java.lang.Thread.run(Thread.java:923)
2020-07-01 23:22:25.090 1089-1855/? E/ActivityThread: Failed to find provider info for com.google.android.apps.wellbeing.api
2020-07-01 23:22:36.673 27554-27554/no.rogo.emptyfuel E/AndroidRuntime: FATAL EXCEPTION: main
Process: no.rogo.emptyfuel, PID: 27554
kotlinx.coroutines.channels.ClosedSendChannelException: Channel was closed
at kotlinx.coroutines.channels.Closed.getSendException(AbstractChannel.kt:1035)
at kotlinx.coroutines.channels.AbstractSendChannel.helpCloseAndResumeWithSendException(AbstractChannel.kt:206)
at kotlinx.coroutines.channels.AbstractSendChannel.access$helpCloseAndResumeWithSendException(AbstractChannel.kt:19)
at kotlinx.coroutines.channels.AbstractSendChannel.sendSuspend(AbstractChannel.kt:196)
at kotlinx.coroutines.channels.AbstractSendChannel.send(AbstractChannel.kt:135)
at kotlinx.coroutines.channels.ChannelCoroutine.send$suspendImpl(Unknown Source:2)
at kotlinx.coroutines.channels.ChannelCoroutine.send(Unknown Source:0)
at androidx.paging.PageFetcherSnapshot$pageEventFlow$1$2$invokeSuspend$$inlined$collect$1.emit(Collect.kt:137)
at kotlinx.coroutines.flow.FlowKt__ChannelsKt.emitAllImpl$FlowKt__ChannelsKt(Channels.kt:58)
at kotlinx.coroutines.flow.FlowKt__ChannelsKt$emitAllImpl$1.invokeSuspend(Unknown Source:11)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at kotlinx.coroutines.EventLoop.processUnconfinedEvent(EventLoop.common.kt:69)
at kotlinx.coroutines.DispatchedTaskKt.resumeUnconfined(DispatchedTask.kt:184)
at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:108)
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:308)
at kotlinx.coroutines.CancellableContinuationImpl.completeResume(CancellableContinuationImpl.kt:395)
at kotlinx.coroutines.channels.AbstractChannel$ReceiveElement.completeResumeReceive(AbstractChannel.kt:872)
at kotlinx.coroutines.channels.ConflatedChannel.offerInternal(ConflatedChannel.kt:61)
at kotlinx.coroutines.channels.ConflatedBroadcastChannel$Subscriber.offerInternal(ConflatedBroadcastChannel.kt:293)
at kotlinx.coroutines.channels.ConflatedBroadcastChannel.offerInternal(ConflatedBroadcastChannel.kt:255)
at kotlinx.coroutines.channels.ConflatedBroadcastChannel.offer(ConflatedBroadcastChannel.kt:236)
at androidx.paging.PageFetcherSnapshot.addHint(PageFetcherSnapshot.kt:189)
at androidx.paging.PageFetcher$PagerUiReceiver.addHint(PageFetcher.kt:118)
at androidx.paging.PagingDataDiffer$collectFrom$2$invokeSuspend$$inlined$collect$1$lambda$1.invokeSuspend(PagingDataDiffer.kt:93)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.UndispatchedCoroutine.afterResume(Builders.common.kt:214)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:113)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7523)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941)
2020-07-01 23:22:37.329 566-653/? E/InputDispatcher: channel '22e16b7 no.rogo.emptyfuel/no.rogo.emptyfuel.ui.activities.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
2020-07-01 23:22:37.855 566-600/? E/KernelCpuSpeedReader: Failed to read cpu-freq: /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state: open failed: ENOENT (No such file or directory)
2020-07-01 23:22:44.918 566-583/? E/JobScheduler.Background: App com.google.android.gms became active but still in NEVER bucket
2020-07-01 23:22:47.900 384-384/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2020-07-01 23:23:09.112 393-393/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
2020-07-01 23:23:47.918 384-384/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2020-07-01 23:23:51.218 14097-27505/? E/SQLiteCastStore: Skip saving CastDeviceInfo: "Nearby device" (__cast_nearby___V_7268191a-9f0d-474c-adca-708ad60ba6c3)
2020-07-01 23:24:09.133 393-393/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
2020-07-01 23:24:46.087 566-1822/? E/RecoverySnapshotStorage: Error reading snapshot for 10107 from disk
java.io.FileNotFoundException: /data/system/recoverablekeystore/snapshots/10107.xml: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:492)
at java.io.FileInputStream.<init>(FileInputStream.java:160)
at com.android.server.locksettings.recoverablekeystore.storage.RecoverySnapshotStorage.readFromDisk(RecoverySnapshotStorage.java:152)
at com.android.server.locksettings.recoverablekeystore.storage.RecoverySnapshotStorage.get(RecoverySnapshotStorage.java:104)
at com.android.server.locksettings.recoverablekeystore.RecoverableKeyStoreManager.getKeyChainSnapshot(RecoverableKeyStoreManager.java:343)
at com.android.server.locksettings.LockSettingsService.getKeyChainSnapshot(LockSettingsService.java:2371)
at com.android.internal.widget.ILockSettings$Stub.onTransact(ILockSettings.java:769)
at android.os.Binder.execTransactInternal(Binder.java:1154)
at android.os.Binder.execTransact(Binder.java:1123)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Linux.open(Native Method)
at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:254)
at libcore.io.IoBridge.open(IoBridge.java:478)
at java.io.FileInputStream.<init>(FileInputStream.java:160)
at com.android.server.locksettings.recoverablekeystore.storage.RecoverySnapshotStorage.readFromDisk(RecoverySnapshotStorage.java:152)
at com.android.server.locksettings.recoverablekeystore.storage.RecoverySnapshotStorage.get(RecoverySnapshotStorage.java:104)
at com.android.server.locksettings.recoverablekeystore.RecoverableKeyStoreManager.getKeyChainSnapshot(RecoverableKeyStoreManager.java:343)
at com.android.server.locksettings.LockSettingsService.getKeyChainSnapshot(LockSettingsService.java:2371)
at com.android.internal.widget.ILockSettings$Stub.onTransact(ILockSettings.java:769)
at android.os.Binder.execTransactInternal(Binder.java:1154)
at android.os.Binder.execTransact(Binder.java:1123)
2020-07-01 23:24:47.933 384-384/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
If it helps...
RG
du...@google.com <du...@google.com> #9
Noting for myself, but looks like this is an issue with using flow.collect
vs flow.collectLatest
, which stops the uireceiver from getting updated in time.
ro...@gmail.com <ro...@gmail.com> #10
Hi again. Managed to rework the logic on using Paging 3, with some of your advices.
But I am now plagued by an SIGABRT error (not often, appears sporadicly, didn't do that before), do this have anything with Paging 3 to do ?
2020-07-03 19:53:14.361 1400-1737/no.rogo.emptyfuel E/StudioTransport: Agent::SubmitAgentTasks error_code=14 'Bad file descriptor' ''
2020-07-03 19:53:16.288 1400-1748/no.rogo.emptyfuel A/libc: fdsan: attempted to close file descriptor 162, expected to be unowned, actually owned by unique_fd 0x79723b86c414
2020-07-03 19:53:16.315 1400-1737/no.rogo.emptyfuel A/libc: fdsan: attempted to close file descriptor 162, expected to be unowned, actually owned by unique_fd 0x79723b86c414
2020-07-03 19:53:16.432 1400-1744/no.rogo.emptyfuel A/libc: fdsan: attempted to close file descriptor 162, expected to be unowned, actually owned by unique_fd 0x79723b86c414
2020-07-03 19:53:17.346 1400-1744/no.rogo.emptyfuel A/libc: Fatal signal 6 (SIGABRT), code -6 (SI_TKILL) in tid 1744 (Studio:Heartbea), pid 1400 (.rogo.emptyfuel)
2020-07-03 19:53:17.598 1400-1744/no.rogo.emptyfuel A/libc: crash_dump helper failed to exec
RG
ro...@gmail.com <ro...@gmail.com> #11
In another hand...
I see that RemoteMediator's "override suspend load" trigger LoadType.PREPEND each time the db is updated from another process, and LoadType.APPEND might trigger sporadicly with state.lastItemOrNull with null, even there are data in the room table.
(I may file another issue for this one, when I have found the supected reason).
RG
ro...@gmail.com <ro...@gmail.com> #12
In another hand 2...
It seems that the LoadType.PREPEND requests are legitimate, but there are subsequent LoadType.APPEND reoccurring (with same PID) when load suspends (IE room database query with "withTransaction") on the first LoadType.APPEND. Shouldn't load wait for the returning MediatorResult before calling load again (Loog for my arrows to the right in table below)?
2020-07-03 20:38:32.883 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: ( loadType = REFRESH )
2020-07-03 20:38:32.885 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: LoadType.REFRESH returning null (initial load)
2020-07-03 20:38:36.177 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: getNullableDeviceLocation = DeviceLocation(userId=user, location_valid=true, timestamp=2020-07-03 20:35:18, latitude=61.8907267, longitude=6.6761067, locationAccuracy=5.0, hasLocationAccuracy=true, altitude=0.0, altitudeAccuracy=0.5, hasAltitude=true, hasAltitudeAccuracy=true, bearing=90.0, bearingAccuracy=30.0, hasBearing=true, hasBearingAccuracy=true, speed=0.0, speedAccuracy=0.5, hasSpeed=true, hasSpeedAccuracy=true, isFromMockProvider=false, provider=fused, countrycode=NO, countryname=Norway, hasCountry=true, countrysource=GPS)
2020-07-03 20:38:36.190 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: resets range to 1.0
2020-07-03 20:38:36.205 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: range = 1.0
2020-07-03 20:38:36.205 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: countryCode = NO
2020-07-03 20:38:36.205 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: userSelection.selectionArea = Global
2020-07-03 20:38:36.205 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: userSelection.selectionSorting = Nearest
2020-07-03 20:38:36.205 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: global, nearest, range = 1.0
2020-07-03 20:38:40.113 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: req.size = 20
2020-07-03 20:38:40.455 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 123431: Tenden kai: 61.898161, 6.706100 -> 61.8907267, 6.6761067
2020-07-03 20:38:40.602 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 567: Gas Tech Stryn: 61.903396, 6.703216 -> 61.8907267, 6.6761067
2020-07-03 20:38:40.708 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 67335: Shell: 61.90265549999999, 6.7093816 -> 61.8907267, 6.6761067
2020-07-03 20:38:40.757 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 528: Grønn Kontakt Stryn: 61.902648, 6.715088 -> 61.8907267, 6.6761067
2020-07-03 20:38:40.772 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 4: YX Stryn: 61.900956, 6.717184 -> 61.8907267, 6.6761067
2020-07-03 20:38:40.817 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 1: Esso Stryn: 61.902877, 6.717453 -> 61.8907267, 6.6761067
2020-07-03 20:38:40.865 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 243: Rema 1000 Stryn: 61.9036521911621, 6.71779918670654 -> 61.8907267, 6.6761067
2020-07-03 20:38:40.879 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 209: Berge Co: 61.9050559997559, 6.72660493850708 -> 61.8907267, 6.6761067
2020-07-03 20:38:40.943 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 2: Circle K Langesethøgda: 61.899546, 6.613435 -> 61.8907267, 6.6761067
2020-07-03 20:38:41.001 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 44: YX Aut. Innvik : 61.851811, 6.614512 -> 61.8907267, 6.6761067
2020-07-03 20:38:41.073 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 127695: YX Innvik: 61.8517929, 6.614505599999998 -> 61.8907267, 6.6761067
2020-07-03 20:38:41.135 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 3: Circle K Automat Olden: 61.841645, 6.811233 -> 61.8907267, 6.6761067
2020-07-03 20:38:41.280 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 127806: Park Mount Skala: 61.86730249999999, 6.879369699999999 -> 61.8907267, 6.6761067
2020-07-03 20:38:41.403 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 6: YX Hornindal: 61.967029, 6.525517 -> 61.8907267, 6.6761067
2020-07-03 20:38:41.436 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 26876: Grønn Kontakt Grodås: 61.969173, 6.525817 -> 61.8907267, 6.6761067
2020-07-03 20:38:41.475 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 127696: Utvik brygge: 61.8066701, 6.528109599999999 -> 61.8907267, 6.6761067
2020-07-03 20:38:41.482 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 73186: mh24 utvik: 61.8065922, 6.518116999999999 -> 61.8907267, 6.6761067
2020-07-03 20:38:41.494 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 506: MH24 Byrkjelo: 61.734587, 6.5068259 -> 61.8907267, 6.6761067
2020-07-03 20:38:41.539 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 832: Viking Byrkjelo: 61.7332361, 6.507499099999999 -> 61.8907267, 6.6761067
2020-07-03 20:38:41.550 4736-4901/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 96161: Grønn Kontakt Byrkjelo: 61.733450, 6.506469 -> 61.8907267, 6.6761067
2020-07-03 20:38:50.603 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: ( loadType = PREPEND )
2020-07-03 20:38:50.604 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: LoadType.PREPEND state.lastItemOrNull()?.stationId = 96161
2020-07-03 20:38:50.604 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: LoadType.PREPEND returning endOfPaginationReached = true
2020-07-03 20:38:50.625 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: ( loadType = APPEND )
2020-07-03 20:38:50.625 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: LoadType.APPEND state.lastItem.stationId = 96161
2020-07-03 20:38:50.632 4736-4904/no.rogo.emptyfuel I/StationListRemoteMediator2: load: LoadType.APPEND querying remoteKeyFromStationId lastItem.stationID = 96161 <--- Suspends !!
2020-07-03 20:38:51.226 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: ( loadType = APPEND ) <--- Another arrives !!
2020-07-03 20:38:51.226 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: LoadType.APPEND state.lastItem.stationId = 96161
2020-07-03 20:38:51.234 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: LoadType.APPEND querying remoteKeyFromStationId lastItem.stationID = 96161 <--- Suspends again !!
2020-07-03 20:38:51.316 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: LoadType.APPEND remoteKeyFromStationId found = StationListRemoteKey(stationId=96161, prevKey=null, nextKey=2) <---Data arrives
2020-07-03 20:38:51.316 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: LoadType.APPEND returning remoteKey.nextKey = 2
2020-07-03 20:38:51.328 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: getNullableDeviceLocation = DeviceLocation(userId=user, location_valid=true, timestamp=2020-07-03 20:38:40, latitude=61.8907267, longitude=6.6761067, locationAccuracy=5.0, hasLocationAccuracy=true, altitude=0.0, altitudeAccuracy=0.5, hasAltitude=true, hasAltitudeAccuracy=true, bearing=90.0, bearingAccuracy=30.0, hasBearing=true, hasBearingAccuracy=true, speed=0.0, speedAccuracy=0.5, hasSpeed=true, hasSpeedAccuracy=true, isFromMockProvider=false, provider=fused, countrycode=NO, countryname=Norway, hasCountry=true, countrysource=GPS)
2020-07-03 20:38:51.355 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: range = 1.0
2020-07-03 20:38:51.356 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: countryCode = NO
2020-07-03 20:38:51.356 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: userSelection.selectionArea = Global
2020-07-03 20:38:51.356 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: userSelection.selectionSorting = Nearest
2020-07-03 20:38:51.356 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: global, nearest, range = 1.0
2020-07-03 20:38:51.785 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: req.size = 20
2020-07-03 20:38:51.788 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 7: CK Bjørnereim : 61.733405, 6.502145 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.789 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 127692: ???? ???? Esso: 61.732023, 6.5071461 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.789 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 45: Best Byrkjelo: 61.7319488525391, 6.50718832015991 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.790 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 130808: Best Byrkjelo: 61.7318791, 6.5069594 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.791 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 82745: YX Hellesylt: 62.08562499999999, 6.870086000000001 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.792 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 835: Circle K Automat Hjelledalen: 61.91847730000001, 7.169982 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.798 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 8: Best Sandane: 61.769847, 6.232689 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.805 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 836: Best: 61.76977239999999, 6.232649899999999 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.811 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 527: Tesla Supercharge Sandane : 61.777968, 6.213336 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.811 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 629: Circle K Automat Sandane: 61.782930, 6.202792 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.813 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 122547: Uno X Nordfjordeid: 61.910468, 6.003159 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.813 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 76385: SHELL CRT NORDFJORDEID: 61.90404, 5.99887 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.817 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 837: Circle K Eid: 61.90622059999999, 5.993726400000001 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.818 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 43: Circle K Nordfjordeid: 61.906135559082, 5.99368333816528 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.819 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 25790: Esso Eid: 61.9063877, 5.991443400000001 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.820 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 760: Grøn Kontakt Amfi Nordfjordeid: 61.908942, 5.985504 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.821 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 838: Yx Geiranger: 62.1026487, 7.2053619 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.824 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 25791: Eid Servicesenter A/S: 61.9121035, 5.980904 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.834 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 10: Esso Nordfjordeid: 61.912197, 5.980782 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.841 4736-4903/no.rogo.emptyfuel I/StationListRemoteMediator2: load: station map 126658: EID: 61.91230869999999, 5.980252399999999 -> 61.8907267, 6.6761067
2020-07-03 20:38:51.943 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: ( loadType = PREPEND )
2020-07-03 20:38:51.944 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: LoadType.PREPEND state.lastItemOrNull()?.stationId = 96161
2020-07-03 20:38:51.944 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: LoadType.PREPEND returning endOfPaginationReached = true
2020-07-03 20:38:52.441 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: ( loadType = PREPEND )
2020-07-03 20:38:52.441 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: LoadType.PREPEND state.lastItemOrNull()?.stationId = 126658
2020-07-03 20:38:52.441 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: LoadType.PREPEND returning endOfPaginationReached = true
2020-07-03 20:39:26.220 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: ( loadType = PREPEND )
2020-07-03 20:39:26.221 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: LoadType.PREPEND state.lastItemOrNull()?.stationId = 126658
2020-07-03 20:39:26.221 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: LoadType.PREPEND returning endOfPaginationReached = true
2020-07-03 20:49:24.820 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: ( loadType = PREPEND )
2020-07-03 20:49:24.820 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: LoadType.PREPEND state.lastItemOrNull()?.stationId = 126658
2020-07-03 20:49:24.821 4736-4736/no.rogo.emptyfuel I/StationListRemoteMediator2: load: LoadType.PREPEND returning endOfPaginationReached = true
Here's my new implementation for the RemoteMediator:
private const val STATION_LIST_STARTING_PAGE_INDEX = 1
@OptIn(ExperimentalPagingApi::class)
class StationListRemoteMediator2(
private val appDatabase: AppDatabase
): RemoteMediator<Int, StationWithKindPrice>(){
private val TAG by lazy { this::class.java.simpleName }
override suspend fun load(
loadType: LoadType,
state: PagingState<Int, StationWithKindPrice>
): MediatorResult {
Log.i(TAG, "load: ( loadType = $loadType )")
var page = when(loadType){
LoadType.REFRESH -> {
Log.i(TAG, "load: LoadType.REFRESH returning null (initial load)")
null
}
LoadType.PREPEND -> {
Log.i(TAG,
"load: LoadType.PREPEND state.lastItemOrNull()?.stationId = " +
"${state.lastItemOrNull()?.stationId}")
Log.i(TAG, "load: LoadType.PREPEND returning endOfPaginationReached = true")
return MediatorResult.Success(endOfPaginationReached = true)
}
LoadType.APPEND -> {
val lastItem = state.lastItemOrNull()?.let {
Log.i(TAG, "load: LoadType.APPEND state.lastItem.stationId = ${it.stationId}")
return@let it
} ?: let {
Log.i(TAG, "load: LoadType.APPEND state.lastItem = null, no data to append")
return MediatorResult.Success(endOfPaginationReached = true)
}
val remoteKey = appDatabase.withTransaction { //Suspecting this suspend to open up for another 'load' call
Log.i(
TAG, "load: LoadType.APPEND querying remoteKeyFromStationId " +
"lastItem.stationID = ${lastItem.stationId}"
)
appDatabase.stationListRemoteKeyDao().remoteKeyFromStationId(lastItem.stationId)
}?.let {
Log.i(TAG, "load: LoadType.APPEND remoteKeyFromStationId found = $it")
return@let it
} ?: let {
Log.w(TAG, "load: LoadType.APPEND remoteKeyFromStationID found null")
return MediatorResult.Success(endOfPaginationReached = true)
}
Log.i(
TAG,
"load: LoadType.APPEND returning remoteKey.nextKey = ${remoteKey.nextKey}"
)
remoteKey.nextKey ?: return MediatorResult.Success(endOfPaginationReached = true)
}
}
try {
if(page==null) page=1
val apiService = APIFamappClientFactory.makeAPIFamappInterfaceService()
var endOfPaginationReached = false
val deviceLocation =
appDatabase.deviceLocationDao().getNullableDeviceLocation()?.let {
Log.i(TAG, "load: getNullableDeviceLocation = $it")
return@let it
} ?:let{
Log.w(TAG, "load: getNullableDeviceLocation == null", )
return MediatorResult.Error(Throwable("No location data!!"))
}
val user = appDatabase.userDao().getUser()
?:return MediatorResult.Error(Throwable("No user registered yet !!"))
val userSelection = appDatabase.userSelectionDao().getNullableUserSelection()
?:return MediatorResult.Error(Throwable("No user selections !!"))
var range:String? = if(page <= 1){
Log.i(TAG, "load: resets range to 1.0")
CoroutineScope(Dispatchers.IO).launch {
appDatabase.userSelectionDao().updateCurrentRange("1.0")
}
"1.0"
} else userSelection.currentRange;
Log.i(TAG, "load: range = $range")
val countryCode: String
countryCode = if(userSelection.selectionAutoCountry)
{
deviceLocation.countrycode
?:user.tmsNWCountryISO?.toUpperCase(Locale.ROOT)
?:user.tmsSIMCountryISO?.toUpperCase(Locale.ROOT)
?:userSelection.selectionCountry?:"--"
}
else
{
userSelection.selectionCountry
?:user.tmsNWCountryISO?.toUpperCase(Locale.ROOT)
?:user.tmsSIMCountryISO?.toUpperCase(Locale.ROOT)
?:deviceLocation.countrycode?:"--"
}
Log.i(TAG,"load: countryCode = $countryCode")
Log.i(TAG,"load: userSelection.selectionArea = ${userSelection.selectionArea}")
Log.i(TAG,"load: userSelection.selectionSorting = ${userSelection.selectionSorting}")
var req: List<APISimpleStation>?=null
if((userSelection.selectionArea == "Country" )
&&(userSelection.selectionSorting == "Nearest"))
{
do {
if (userSelection.selectionAutoCountry) {
Log.i(TAG, "load: country, nearest, selectionAutoCountry = true, range = $range")
req = apiService.getSimpleStationsCountryNearest(
userid = user.userId,
passfrase = user.passfrase,
country = countryCode,
latitude = deviceLocation.latitude.toString().format(Locale.ROOT, "%s"),
longitude = deviceLocation.longitude.toString()
.format(Locale.ROOT, "%s"),
limit = state.config.pageSize.toString(),
offset = ((page - 1) * state.config.pageSize).toString(),
lastversion = user.currentVersion,
killed = if (userSelection.showHidden) "1" else "0",
range = range ?: "1.0" //may be changed
)
} else {
Log.i(TAG, "load: country, nearest, selectionAutoCountry = false, range = $range")
val countryData = appDatabase.countryDao().getCountryByCode(countryCode)
Log.i(TAG, "load: autoCountry not auto set = ${countryData?.isoCC2}")
req = apiService.getSimpleStationsCountryNearest(
userid = user.userId,
passfrase = user.passfrase,
country = countryCode,
latitude = (countryData?.latitude_center ?: 0.0F).toString()
.format(Locale.ROOT, "%s"),
longitude = (countryData?.longitude_center ?: 0.0F).toString()
.format(Locale.ROOT, "%s"),
limit = state.config.pageSize.toString(),
offset = ((page - 1) * state.config.pageSize).toString(),
lastversion = user.currentVersion,
killed = if (userSelection.showHidden) "1" else "0",
range = range ?: "1.0" //must be changed
)
}
Log.i(TAG, "load: req.size = ${req.size}")
if(req.isEmpty()) range = increaseRange(range)
else break
}while (range != null)
}else if((userSelection.selectionArea == "Global")
&&(userSelection.selectionSorting == "Nearest"))
{
do{
Log.i(TAG, "load: global, nearest, range = $range")
req = apiService.getSimpleStationsGlobalNearest(
userid = user.userId,
passfrase = user.passfrase,
latitude = deviceLocation.latitude.toString().format(Locale.ROOT,"%s"),
longitude = deviceLocation.longitude.toString().format(Locale.ROOT,"%s"),
limit = state.config.pageSize.toString(),
offset = ((page-1)*state.config.pageSize).toString(),
lastversion = user.currentVersion,
killed = if(userSelection.showHidden) "1" else "0",
range = range?:"1.0"
)
Log.i(TAG, "load: req.size = ${req.size}")
if(req.isEmpty()) range = increaseRange(range)
else break
}while (range != null)
}else if((userSelection.selectionArea == "Country")
&&(userSelection.selectionSorting == "Latest"))
{
Log.i(TAG, "load: country, latest")
req = apiService.getSimpleStationsCountryLatest(
userid = user.userId,
passfrase = user.passfrase,
country = countryCode,
limit = state.config.pageSize.toString(),
offset = ((page-1)*state.config.pageSize).toString(),
lastversion = user.currentVersion,
killed = if(userSelection.showHidden) "1" else "0"
)
}else if((userSelection.selectionArea == "Global")
&&(userSelection.selectionSorting == "Latest"))
{
Log.i(TAG, "load: global, latest")
req = apiService.getSimpleStationsGlobalLatest(
userid = user.userId,
passfrase = user.passfrase,
limit = state.config.pageSize.toString(),
offset = ((page-1)*state.config.pageSize).toString(),
lastversion = user.currentVersion,
killed = if(userSelection.showHidden) "1" else "0"
)
}
//TODO: Add rest
endOfPaginationReached = req?.isEmpty()
?:return MediatorResult.Error(Throwable("No data could be read from backend..."))
appDatabase.withTransaction {
if(loadType == LoadType.REFRESH)
{
appDatabase.stationListRemoteKeyDao().clearStationListRemoteKeys()
appDatabase.stationDao().nukeTable() //Nuke station table
}
val prevKey = if(page == STATION_LIST_STARTING_PAGE_INDEX) null else page -1
val nextKey = if(endOfPaginationReached) null else page + 1
val keys = req.map {
StationListRemoteKey(
stationId = it.idsite,
prevKey = prevKey,
nextKey = nextKey)
}
val stations = req.map{
Log.i(
TAG,
"load: station map ${it.idsite}: ${it.stationname}: ${it.latitude}, ${it.longitude} -> ${deviceLocation.latitude}, ${deviceLocation.longitude}"
)
Station(
stationId = it.idsite,
stationName = it.stationname,
longitude = it.longitude.toDoubleOrNull(),
latitude = it.latitude.toDoubleOrNull(),
airDistance = (locationDistance(
it.latitude.toDoubleOrNull(),
it.longitude.toDoubleOrNull(),
deviceLocation.latitude,
deviceLocation.longitude
)?:0.0)/1000.0,
enterpriseId = it.enterpriseid,
googlePlaceId = it.googleplaceid,
stationAddress = it.stationaddress,
stationPlace = it.stationplace,
stationZip = it.stationzip,
stationCountryCode = it.countrycode,
killed = it.killed?.equals("1")?:false,
dateCreated =it.datecreated,
stationCountry = it.stationcountry
)
}
appDatabase.stationListRemoteKeyDao().insertAll(keys)
appDatabase.stationDao().insertAll(stations)
}
return MediatorResult.Success(endOfPaginationReached = endOfPaginationReached)
}catch (exception: IOException)
{
return MediatorResult.Error(exception)
}
catch (exception: HttpException)
{
return MediatorResult.Error(exception)
}
}
fun increaseRange(inRange: String?): String? {
var fRange:Float = inRange?.toFloatOrNull()?:1.0F
fRange += 1.0F
Log.i(TAG, "increaseRange: fRange = $fRange")
val rRange = if(fRange>180.0F) null
else fRange.toString().format(Locale.ROOT,"%0.1f")
CoroutineScope(Dispatchers.IO).launch {
appDatabase.userSelectionDao().updateCurrentRange(rRange)
}
return rRange
}
fun locationDistance(
fromLatitude: Double?,
fromLongitude: Double?,
toLatitude: Double?,
toLongitude : Double?
):Double?{
fromLatitude?:return null
fromLongitude?:return null
toLatitude?:return null
toLongitude?:return null
val fromLocation = Location("FromLocation")
val toLocation = Location("ToLocation")
fromLocation.latitude = fromLatitude
fromLocation.longitude = fromLongitude
toLocation.latitude = toLatitude
toLocation.longitude = toLongitude
return fromLocation.distanceTo(toLocation).toDouble()
}
}
If I have time, I will give you a working proof-of-concept of the issue.
RG
ro...@gmail.com <ro...@gmail.com> #13
du...@google.com <du...@google.com> #14
I'm not sure I understand the issue you're hitting, but APPEND
and PREPEND
can happen at the same time. It's possible for a PagingData
to PREPEND
and APPEND
concurrently given sufficient PagingConfig.maxSize
.
ro...@gmail.com <ro...@gmail.com> #15
doing a query in room) it seems that there will be another load (APPEND)
attempt, which again will do the same processing and suspend call). There
may be many such suspending calls upon each other querying the same values.
Until one of the suspended calls returns with results.
RG
fre. 3. jul. 2020, 21:54 skrev <buganizer-system@google.com>:
du...@google.com <du...@google.com> #16
Ah I see, so you expect cancellation to propagate there - interesting. Thanks for the report!
du...@google.com <du...@google.com> #17
We actually do have something for this, but looks like it's not working correctly. We're on holiday so I'll need to take a look a bit later :)
ro...@gmail.com <ro...@gmail.com> #18
Okei, same here. Happy holiday !! RG
du...@google.com <du...@google.com> #19
For others hitting this issue - the workaround is to use .collectLatest
instead of .collect
on your Flow<PagingData<T>>
.
to...@gtempaccount.com <to...@gtempaccount.com> #20
It seems to be happening when saving remote data to the database. The only solution Could find for now to prevent this, was to put an arbitrary delay between the fetching of the data and the saving of the data to the db like so:
getOffset()
.flatMap { offset -> remote.getItems(offset) }
.delay(200, TimeUnit.MILLISECONDS)
.map { result -> if(result is Success) local.save(result.items)}
If you want to see an example, my pet project is here
Thanks
du...@google.com <du...@google.com>
ap...@google.com <ap...@google.com> #21
Branch: androidx-master-dev
commit 93e69a2a4078d574f0d27502e7fb2d7882edcd97
Author: Dustin Lam <dustinlam@google.com>
Date: Mon Jul 20 21:20:44 2020
Prevent ClosedSendChannelException when using synchronous submitData
RelNote: "Fixed a bug where using the synchronous variant of submitData
would sometimes lead to a race causing ClosedSendChannelException"
Fixes: 160192222
Test: ./gradlew paging:paging-common:test
Change-Id: I4d70208a6def82099644ec88b087426a1ae0cffd
M paging/common/src/main/kotlin/androidx/paging/PageFetcherSnapshot.kt
M paging/common/src/test/kotlin/androidx/paging/PageFetcherSnapshotTest.kt
M paging/common/src/test/kotlin/androidx/paging/PageFetcherTest.kt
M testutils/testutils-paging/src/main/java/androidx/paging/TestPagingSource.kt
de...@gmail.com <de...@gmail.com> #22
ro...@gmail.com <ro...@gmail.com> #23
Theres a new alpha04 release where some of the mentioned issues above are mentioned.
RG
du...@google.com <du...@google.com> #24
The "Channel was closed" exception should be fixed by the latest release, thanks for being patient!
Description
Component used:
Version used: Devices/Android versions reproduced on:
If this is a bug in the library, we would appreciate if you could attach:
Have migrated from paging 2.1.0 to 3.0.0, but are plagued by the "Channel was closed" exception when other (not paging 3.0 related code) is updating the Room db where the paging data is resided. This update may change the order in the resulting list also.
Is this due to Flow being used at the moment when the background process is updating data ? Room shoud be able to do this update and suspend/postpone/queue it until the Flow has done its updates to the UI.
Here is the errormessage:
RG