Skip to content

Move multi-source image disk cache checks off the UI thread - #58701

Open
Abbondanzo wants to merge 2 commits into
react:mainfrom
Abbondanzo:export-D122082126
Open

Abbondanzo wants to merge 2 commits into
react:mainfrom
Abbondanzo:export-D122082126

Conversation

@Abbondanzo

Copy link
Copy Markdown
Contributor

Summary:
Avoid synchronous disk I/O while Android selects a source for multi-source images. The best source and bitmap-memory-cache candidate are selected immediately, then Fresco's asynchronous disk-cache API finds the most precise cached source and upgrades the request when it completes.

Both Android image-view implementations reject stale callbacks after a new request, source update, size change, or detach. The behavior remains behind a disabled-by-default runtime gate.

Changelog:
[Android][Fixed] - Avoid blocking the UI thread while selecting multi-source images

Differential Revision: D122082126

…ct#58657)

Summary:

Programmatic list scrolling can move to an edge before asynchronously scheduled cells finish rendering. The scroll handler then skips the edge callback because the terminal cell is not yet in the render window, and no later scroll or layout event is guaranteed.

Recheck edge callbacks after post-scroll render updates. Track the item count when an edge callback is sent so internal measurement changes cannot emit duplicates while the list remains at the same edge; appending data or scrolling away re-arms the callback.

Changelog:
[General][Fixed] - Fire `VirtualizedList` edge callbacks after programmatic scrolling

Differential Revision: D100870075
Summary:
Avoid synchronous disk I/O while Android selects a source for multi-source images. The best source and bitmap-memory-cache candidate are selected immediately, then Fresco's asynchronous disk-cache API finds the most precise cached source and upgrades the request when it completes.

Both Android image-view implementations reject stale callbacks after a new request, source update, size change, or detach. The behavior remains behind a disabled-by-default runtime gate.

Changelog:
[Android][Fixed] - Avoid blocking the UI thread while selecting multi-source images

Differential Revision: D122082126
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 28, 2026
@meta-codesync

meta-codesync Bot commented Sep 28, 2026

Copy link
Copy Markdown

@Abbondanzo has exported this pull request. If you are a Meta employee, you can view the originating Diff in D122082126.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant