Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android overload of renderWorkflowIn short circuits in surprising ways. #822

Open
rjrjr opened this issue Jun 24, 2022 · 0 comments
Open
Labels
ui Related to UI integration
Milestone

Comments

@rjrjr
Copy link
Contributor

rjrjr commented Jun 24, 2022

The Android-specific renderWorkflowIn function is a convenience function that minimizes the fuss required to get androidx to save and restore TreeSnapshot. Because it maps our usual StateFlow<RenderingAndSnapshot> to just StateFlow<RenderingT>, it will short circuit if the root rendering type implements equals() in a naive way -- like a data class does, say. (RenderingAndSnapshot has plain old default instance equality, so this is a non-issue in our core method.)

This is pretty surprising when it happens, and hard to debug if you're not aware of StateFlow's behavior. I don't think punching up the kdoc is a reasonable answer.

I'm wondering if we can find another way to be convenient, maybe by building that snapshot handling into WorkflowLayout itself.

I'd consider this a blocker to workflow UI leaving beta.

@rjrjr rjrjr added the ui Related to UI integration label Jun 24, 2022
@rjrjr rjrjr added this to the ui-1.0 milestone Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui Related to UI integration
Projects
None yet
Development

No branches or pull requests

1 participant