Skip to content

Use global scope for global operation in insights management#9742

Merged
malinajirka merged 1 commit intofeature/manage_insights_readonlyfrom
feature/fix_coroutine_in_insights
Apr 29, 2019
Merged

Use global scope for global operation in insights management#9742
malinajirka merged 1 commit intofeature/manage_insights_readonlyfrom
feature/fix_coroutine_in_insights

Conversation

@planarvoid
Copy link
Copy Markdown
Contributor

There was a bug when adding a new block to insights for the first time, it would get stuck in an infinite loading state. This was caused by the coroutine getting stopped because the ViewModel was closed when we have saved the Insights management activity (activity finish triggers ViewModel clean which cancels the coroutine). To fix this I'm replacing a coroutine with a local scope with the one with global scope. This guarantees that the coroutine will always finish.

To test:

  • Go to Stats/Insights
  • Scroll down to "Edit"
  • Click on "Edit"
  • Add a new block to insights
  • Click "Save"
  • You go back to Insights and the block is loaded

@planarvoid planarvoid added this to the 12.4 milestone Apr 29, 2019
@planarvoid planarvoid requested a review from malinajirka April 29, 2019 08:56
@planarvoid planarvoid self-assigned this Apr 29, 2019
@malinajirka
Copy link
Copy Markdown
Contributor

Looks and works as expected. Thanks!

@malinajirka malinajirka merged commit 05adf40 into feature/manage_insights_readonly Apr 29, 2019
@malinajirka malinajirka deleted the feature/fix_coroutine_in_insights branch April 29, 2019 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants