RxSwiftCommunity / RxFlow

RxFlow is a navigation framework for iOS applications based on a Reactive Flow Coordinator pattern
MIT License
1.88k stars 118 forks source link

Child controllers are never deallocated #181

Closed claustrofob closed 1 year ago

claustrofob commented 2 years ago

If a flow contributor was initialised with allowStepWhenDismissed: true then all its immediate child controllers that provide flow contributors are never deallocated.

The bug is reproducible on RxFlowDemo as well:

  1. In DashboardFlow.navigateToDashboard() set:
        return .multiple(flowContributors: [
            .contribute(
                withNextPresentable: wishListFlow,
                withNextStepper: CompositeStepper(steppers: [OneStepper(withSingleStep: DemoStep.moviesAreRequired), wishlistStepper]),
                allowStepWhenNotPresented: true,
                allowStepWhenDismissed: true
            ),
            .contribute(
                withNextPresentable: watchedFlow,
                withNextStepper: OneStepper(withSingleStep: DemoStep.moviesAreRequired),
                allowStepWhenNotPresented: true,
                allowStepWhenDismissed: true
            ),
            .contribute(
                withNextPresentable: trendingFlow,
                withNextStepper: trendingStepper,
                allowStepWhenNotPresented: true,
                allowStepWhenDismissed: true
            )
        ])
  2. In app go to Wishlist -> Movie Details Screen. Then go back and verify that MovieDetailViewController was not deallocated.
  3. Now in WishlistFlow.navigateToMovieDetailScreen change
        return .one(
            flowContributor: .contribute(
                withNextPresentable: viewController,
                withNextStepper: viewController.viewModel
            )
        )

    to

    return .none
  4. Now repeat step 2 and verify that MovieDetailViewController is deallocated now.
erginbilgin commented 2 years ago

Is there any update on this one? It seems to be the case for me too.

twittemb commented 2 years ago

Hi,

Sorry for the late answer, I’ll try to take a look ASAP.

leolobato commented 2 years ago

Any updates on this one? I can confirm I'm also running into this same issue.

mgray88 commented 1 year ago

Confirmed still exists in current version (2.13.0)

mgray88 commented 1 year ago

I can't say I've ever used this functionality and can't think of a use case for it. If anyone is able to provide a good use case I will look further into the issue.

Otherwise closing as wontfix