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

Provide proper initial states for nav model flows #239

Merged
merged 1 commit into from
Oct 21, 2022

Conversation

CherryPerry
Copy link
Collaborator

@CherryPerry CherryPerry commented Oct 21, 2022

Description

Fixes #235

StateFlows are killing me...

The issue log:

  • BackStack is recreated from saved state.
  • Because BackStack uses stateIn(initialValue = emptyList(), empty list is produced as the first value when subscribed.
  • ChildNodeCreationManager restores children from saved state and subscribes to BackStack.
  • Because BackStack returns empty list ChildNodeCreationManager drops the restored children.
  • Then BackStack sends the restored list and ChildNodeCreationManager recreates children from scratch (they were dropped on the previous step).

No tests, sorry.

Check list

  • I have updated CHANGELOG.md if required.
  • I have updated documentation if required.

Copy link
Collaborator

@KovalevAndrey KovalevAndrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed on writing state restoration test

@CherryPerry CherryPerry force-pushed the restoration-bug branch 2 times, most recently from ddc098a to 1621263 Compare October 21, 2022 15:05
@CherryPerry CherryPerry marked this pull request as ready for review October 21, 2022 15:05
Copy link
Collaborator

@LachlanMcKee LachlanMcKee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIce find. Hopefully they add that into newer versions of the library =|

@CherryPerry CherryPerry merged commit 55c00c2 into bumble-tech:1.x Oct 21, 2022
@CherryPerry CherryPerry deleted the restoration-bug branch October 21, 2022 15:34
@CherryPerry CherryPerry added bug Something isn't working backwards-compatible labels Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backwards-compatible bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backstack history/state is lost on orientation changes for nested parent nodes
3 participants