Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
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
https://android-review.googlesource.com/1123258
https://goto.google.com/android-sha1/b90079595f33f58fece04026a97faa0d243acdb1
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
ap...@google.com <ap...@google.com> #3
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
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 ( b/140759491 ).
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
https://android-review.googlesource.com/1288456
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
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit ac66217143e9cae0482c679f6508ade6285439dd
Author: Clara Fok <clarafok@google.com>
Date: Wed Jul 13 13:45:20 2022
Add VERBOSE level logging for each PageEvent sent to presenter side
Sample Insert log without mediator:
PageEvent.Insert for REFRESH, with 6 items (
first item: Item(pagingSourceId=0, generation=0, value=0, metadata=null)
last item: Item(pagingSourceId=0, generation=0, value=5, metadata=null)
placeholdersBefore: -1
placeholdersAfter: 5840
sourceLoadStates: LoadStates(refresh=NotLoading(endOfPaginationReached=false), prepend=NotLoading(endOfPaginationReached=true), append=NotLoading(endOfPaginationReached=false))
)
Sample Insert log with mediator:
PageEvent.Insert for REFRESH, with 6 items (
first item: Item(pagingSourceId=0, generation=0, value=0, metadata=null)
last item: Item(pagingSourceId=0, generation=0, value=5, metadata=null)
placeholdersBefore: 0
placeholdersAfter: 0
sourceLoadStates: LoadStates(refresh=NotLoading(endOfPaginationReached=false), prepend=NotLoading(endOfPaginationReached=true), append=NotLoading(endOfPaginationReached=false))
mediatorLoadStates: LoadStates(refresh=NotLoading(endOfPaginationReached=false), prepend=NotLoading(endOfPaginationReached=true), append=NotLoading(endOfPaginationReached=false))
)
Sample LoadStateUpdate log:
PageEvent.LoadStateUpdate (
sourceLoadStates: LoadStates(refresh=NotLoading(endOfPaginationReached=false), prepend=NotLoading(endOfPaginationReached=true), append=Loading(endOfPaginationReached=false))
mediatorLoadStates: LoadStates(refresh=NotLoading(endOfPaginationReached=false), prepend=NotLoading(endOfPaginationReached=true), append=Loading(endOfPaginationReached=false))
)
Sample StaticList log:
PageEvent.StaticList with 10 items (
first item: Item(id=150, text=item 150 - port, bgColor=-16776961)
last item: Item(id=159, text=item 159 - port, bgColor=-16776961)
sourceLoadStates: LoadStates(refresh=NotLoading(endOfPaginationReached=false), prepend=NotLoading(endOfPaginationReached=true), append=NotLoading(endOfPaginationReached=false))
mediatorLoadStates: LoadStates(refresh=NotLoading(endOfPaginationReached=false), prepend=NotLoading(endOfPaginationReached=true), append=Loading(endOfPaginationReached=false))
)
Sample PREPEND Drop log:
PageEvent.Drop from the front (
minPageOffset: 2
maxPageOffset: 4
placeholdersRemaining: 10
)
Test: n/a
Bug: 235527159
Change-Id: I278622c77150ef0c58a60577565fcbdb3fbea43a
M paging/paging-common/src/main/kotlin/androidx/paging/PageFetcher.kt
M paging/paging-common/src/main/kotlin/androidx/paging/PageEvent.kt
M paging/paging-common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt
https://android-review.googlesource.com/2152994
Branch: androidx-main
commit ac66217143e9cae0482c679f6508ade6285439dd
Author: Clara Fok <clarafok@google.com>
Date: Wed Jul 13 13:45:20 2022
Add VERBOSE level logging for each PageEvent sent to presenter side
Sample Insert log without mediator:
PageEvent.Insert for REFRESH, with 6 items (
first item: Item(pagingSourceId=0, generation=0, value=0, metadata=null)
last item: Item(pagingSourceId=0, generation=0, value=5, metadata=null)
placeholdersBefore: -1
placeholdersAfter: 5840
sourceLoadStates: LoadStates(refresh=NotLoading(endOfPaginationReached=false), prepend=NotLoading(endOfPaginationReached=true), append=NotLoading(endOfPaginationReached=false))
)
Sample Insert log with mediator:
PageEvent.Insert for REFRESH, with 6 items (
first item: Item(pagingSourceId=0, generation=0, value=0, metadata=null)
last item: Item(pagingSourceId=0, generation=0, value=5, metadata=null)
placeholdersBefore: 0
placeholdersAfter: 0
sourceLoadStates: LoadStates(refresh=NotLoading(endOfPaginationReached=false), prepend=NotLoading(endOfPaginationReached=true), append=NotLoading(endOfPaginationReached=false))
mediatorLoadStates: LoadStates(refresh=NotLoading(endOfPaginationReached=false), prepend=NotLoading(endOfPaginationReached=true), append=NotLoading(endOfPaginationReached=false))
)
Sample LoadStateUpdate log:
PageEvent.LoadStateUpdate (
sourceLoadStates: LoadStates(refresh=NotLoading(endOfPaginationReached=false), prepend=NotLoading(endOfPaginationReached=true), append=Loading(endOfPaginationReached=false))
mediatorLoadStates: LoadStates(refresh=NotLoading(endOfPaginationReached=false), prepend=NotLoading(endOfPaginationReached=true), append=Loading(endOfPaginationReached=false))
)
Sample StaticList log:
PageEvent.StaticList with 10 items (
first item: Item(id=150, text=item 150 - port, bgColor=-16776961)
last item: Item(id=159, text=item 159 - port, bgColor=-16776961)
sourceLoadStates: LoadStates(refresh=NotLoading(endOfPaginationReached=false), prepend=NotLoading(endOfPaginationReached=true), append=NotLoading(endOfPaginationReached=false))
mediatorLoadStates: LoadStates(refresh=NotLoading(endOfPaginationReached=false), prepend=NotLoading(endOfPaginationReached=true), append=Loading(endOfPaginationReached=false))
)
Sample PREPEND Drop log:
PageEvent.Drop from the front (
minPageOffset: 2
maxPageOffset: 4
placeholdersRemaining: 10
)
Test: n/a
Bug: 235527159
Change-Id: I278622c77150ef0c58a60577565fcbdb3fbea43a
M paging/paging-common/src/main/kotlin/androidx/paging/PageFetcher.kt
M paging/paging-common/src/main/kotlin/androidx/paging/PageEvent.kt
M paging/paging-common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit 4163656d8170ebba389ae2b69c14b54f0f6e3449
Author: Clara Fok <clarafok@google.com>
Date: Wed Jul 27 18:08:35 2022
Add DEBUG and VERBOSE default logging for PagingSource loads
Two levels of logging were added to reflect the start and end of all load types. Load start and load success are DEBUG level logs, while result of Error, Invalid, and cancelled loads are VERBOSE level logs. Examples of log outputs as follows.
Load Start:
Start REFRESH with loadKey 50 on androidx.paging.TestPagingSource@fd4857
Load Success:
End REFRESH with loadKey 50. Returned LoadResult.Page(
dataCount: 2
first Item: 50
last Item: 51
nextKey: 52
prevKey: 49
itemsBefore: 50
itemsAfter: 48
)
Load Error:
End REFRESH with loadKey 50. Returned LoadResult.Error(
throwable: java.lang.Exception: Exception from TestPagingSource.errorNextLoad
)
Load Invalid:
End REFRESH with loadKey 50. Returned LoadResult.Invalid
Load Cancelled:
End APPEND with loadkey 60. Load CANCELLED.
Test: n/a
Bug: 235527159
Change-Id: Ideef3df4ed52eb5fb62a1cbde1556e426cd377ba
M paging/paging-common/src/main/kotlin/androidx/paging/PagingSource.kt
M paging/paging-common/src/main/kotlin/androidx/paging/PageFetcherSnapshot.kt
https://android-review.googlesource.com/2167581
Branch: androidx-main
commit 4163656d8170ebba389ae2b69c14b54f0f6e3449
Author: Clara Fok <clarafok@google.com>
Date: Wed Jul 27 18:08:35 2022
Add DEBUG and VERBOSE default logging for PagingSource loads
Two levels of logging were added to reflect the start and end of all load types. Load start and load success are DEBUG level logs, while result of Error, Invalid, and cancelled loads are VERBOSE level logs. Examples of log outputs as follows.
Load Start:
Start REFRESH with loadKey 50 on androidx.paging.TestPagingSource@fd4857
Load Success:
End REFRESH with loadKey 50. Returned LoadResult.Page(
dataCount: 2
first Item: 50
last Item: 51
nextKey: 52
prevKey: 49
itemsBefore: 50
itemsAfter: 48
)
Load Error:
End REFRESH with loadKey 50. Returned LoadResult.Error(
throwable: java.lang.Exception: Exception from TestPagingSource.errorNextLoad
)
Load Invalid:
End REFRESH with loadKey 50. Returned LoadResult.Invalid
Load Cancelled:
End APPEND with loadkey 60. Load CANCELLED.
Test: n/a
Bug: 235527159
Change-Id: Ideef3df4ed52eb5fb62a1cbde1556e426cd377ba
M paging/paging-common/src/main/kotlin/androidx/paging/PagingSource.kt
M paging/paging-common/src/main/kotlin/androidx/paging/PageFetcherSnapshot.kt
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-main
commit 386e82daf006a7876946d0fe3cac5145db6719fc
Author: Clara Fok <clarafok@google.com>
Date: Thu Jul 28 16:00:37 2022
Add default log to trace load and invalidation triggers
Log sites to track input:
items access (i.e. from regular scrolling or jump scrolls)
refresh
retry
Log sites to reflect input received:
Jump invalidation
PagingSource invalidation
New PagingSource generation
Example of log output as follows.
Generated new PagingSource:
Generated new PagingSource androidx.paging.integration.testapp.v3.ItemPagingSource@19bff0f
Items access:
Accessing item index[12]
Jump invalidation:
Jump triggered on PagingSource androidx.paging.integration.testapp.v3.ItemPagingSource@19bff0f by ViewportHint.Access(
pageOffset=2,
indexInPage=60,
presentedItemsBefore=100,
presentedItemsAfter=-51,
originalPageOffsetFirst=0,
originalPageOffsetLast=2,
)
PagingSource invalidation:
Invalidated PagingSource androidx.paging.integration.testapp.v3.ItemPagingSource@19bff0f
Test: n/a
Bug: 235527159
Change-Id: Ia36dc2a3bc68e24bd03d579d1508b0987140d669
M paging/paging-common/src/main/kotlin/androidx/paging/InvalidateCallbackTracker.kt
M paging/paging-common/src/main/kotlin/androidx/paging/PageFetcher.kt
M paging/paging-common/src/main/kotlin/androidx/paging/PagingSource.kt
M paging/paging-common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt
M paging/paging-common/src/main/kotlin/androidx/paging/PageFetcherSnapshot.kt
https://android-review.googlesource.com/2169479
Branch: androidx-main
commit 386e82daf006a7876946d0fe3cac5145db6719fc
Author: Clara Fok <clarafok@google.com>
Date: Thu Jul 28 16:00:37 2022
Add default log to trace load and invalidation triggers
Log sites to track input:
items access (i.e. from regular scrolling or jump scrolls)
refresh
retry
Log sites to reflect input received:
Jump invalidation
PagingSource invalidation
New PagingSource generation
Example of log output as follows.
Generated new PagingSource:
Generated new PagingSource androidx.paging.integration.testapp.v3.ItemPagingSource@19bff0f
Items access:
Accessing item index[12]
Jump invalidation:
Jump triggered on PagingSource androidx.paging.integration.testapp.v3.ItemPagingSource@19bff0f by ViewportHint.Access(
pageOffset=2,
indexInPage=60,
presentedItemsBefore=100,
presentedItemsAfter=-51,
originalPageOffsetFirst=0,
originalPageOffsetLast=2,
)
PagingSource invalidation:
Invalidated PagingSource androidx.paging.integration.testapp.v3.ItemPagingSource@19bff0f
Test: n/a
Bug: 235527159
Change-Id: Ia36dc2a3bc68e24bd03d579d1508b0987140d669
M paging/paging-common/src/main/kotlin/androidx/paging/InvalidateCallbackTracker.kt
M paging/paging-common/src/main/kotlin/androidx/paging/PageFetcher.kt
M paging/paging-common/src/main/kotlin/androidx/paging/PagingSource.kt
M paging/paging-common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt
M paging/paging-common/src/main/kotlin/androidx/paging/PageFetcherSnapshot.kt
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-main
commit 1dcb2e545c7690148e96f1a011a51ccce0df417f
Author: Clara Fok <clarafok@google.com>
Date: Fri Jul 29 16:06:43 2022
Add VERBOSE log when new page is presented
Since compose calls PagingDataDiffer's implementation of presentNewList, this log will apply to both RC and Compose UI.
Sample output:
Presenting data:
first item: Item(id=90, text=item 90 - port, bgColor=-65536)
last item: Item(id=119, text=item 119 - port, bgColor=-65536)
placeholdersBefore: 90
placeholdersAfter: 5880
hintReceiver: androidx.paging.PageFetcher$PagerHintReceiver@c6743b4
sourceLoadStates: LoadStates(refresh=NotLoading(endOfPaginationReached=false), prepend=NotLoading(endOfPaginationReached=false), append=NotLoading(endOfPaginationReached=false))
)
Test: n/a
Fixes: 235527159
Change-Id: I40a565be98501952bf467b830efc605361a77a81
M paging/paging-common/src/main/kotlin/androidx/paging/PageEvent.kt
M paging/paging-common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt
A paging/paging-common/src/main/kotlin/androidx/paging/internal/LogUtil.kt
https://android-review.googlesource.com/2170604
Branch: androidx-main
commit 1dcb2e545c7690148e96f1a011a51ccce0df417f
Author: Clara Fok <clarafok@google.com>
Date: Fri Jul 29 16:06:43 2022
Add VERBOSE log when new page is presented
Since compose calls PagingDataDiffer's implementation of presentNewList, this log will apply to both RC and Compose UI.
Sample output:
Presenting data:
first item: Item(id=90, text=item 90 - port, bgColor=-65536)
last item: Item(id=119, text=item 119 - port, bgColor=-65536)
placeholdersBefore: 90
placeholdersAfter: 5880
hintReceiver: androidx.paging.PageFetcher$PagerHintReceiver@c6743b4
sourceLoadStates: LoadStates(refresh=NotLoading(endOfPaginationReached=false), prepend=NotLoading(endOfPaginationReached=false), append=NotLoading(endOfPaginationReached=false))
)
Test: n/a
Fixes: 235527159
Change-Id: I40a565be98501952bf467b830efc605361a77a81
M paging/paging-common/src/main/kotlin/androidx/paging/PageEvent.kt
M paging/paging-common/src/main/kotlin/androidx/paging/PagingDataDiffer.kt
A paging/paging-common/src/main/kotlin/androidx/paging/internal/LogUtil.kt
Description
Component used: Paging
Version used: 3.2.0-alpha01
Similar to what is available in FragmentManager logging , it would be helpful if Paging had a way to enable debug and verbose logging that would help with figuring out what is happening internally within Paging without having to recompile the app or make changes to the Paging library simply by running an
adb shell
command:Ideally this should have more critical logging at the
DEBUG
level while having more detailed logging of events at theVERBOSE
level.