Skip to content

[android]: ModalContainer Destroy commit allowing state loss#23400

Merged
PureWeen merged 6 commits into
dotnet:mainfrom
lampo:rs-lkroneman/android-modal-container-destroy-allowing-state-loss
Jul 11, 2024
Merged

[android]: ModalContainer Destroy commit allowing state loss#23400
PureWeen merged 6 commits into
dotnet:mainfrom
lampo:rs-lkroneman/android-modal-container-destroy-allowing-state-loss

Conversation

@rs-lkroneman

@rs-lkroneman rs-lkroneman commented Jul 2, 2024

Copy link
Copy Markdown
Contributor

Description of Change

While an animation is in progress and the app is backgrounded the app crashes with an java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState

This is currently our number 1 exception in production.

All of our stack traces point to the ModalContainer.Destroy() method

Issues Fixed

Android crashes on Modal Animation when backgrounded

Fixes #23399

@rs-lkroneman rs-lkroneman requested a review from a team as a code owner July 2, 2024 15:10
@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Jul 2, 2024
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey there @rs-lkroneman! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@rs-lkroneman

rs-lkroneman commented Jul 3, 2024

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree company="Ramsey Solutions"

App.ForegroundApp();
App.WaitForElement("OpenModal");
}
catch

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't need these bits anymore

We had to do this before we were just restarting the app between every test

So, you're fine to just remove this try/catch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@PureWeen removed the try catch block in.

a964d40

@PureWeen

PureWeen commented Jul 3, 2024

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

{
public override string Issue => "Closing Modal While App is Backgrounded Fails";

[Test]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
[Test]
[Test]
[Category(UITestCategories.Navigation)]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added the category in a964d40

{
public override string Issue => "Closing Modal While App is Backgrounded Fails";

[Test]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We'll need to add a Category to this before merging. We recently merged some changes that requires every test to have a Category

I would add it myself, but, it looks like I don't have permission to make changes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@PureWeen it's probably because I forked the repository into our organization's workspace.

Added the category.

@PureWeen

PureWeen commented Jul 9, 2024

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen merged commit e897b3f into dotnet:main Jul 11, 2024
@samhouts samhouts added fixed-in-net9.0-nightly This may be available in a nightly release! fixed-in-net8.0-nightly This may be available in a nightly release! fixed-in-8.0.80 and removed fixed-in-net9.0-nightly This may be available in a nightly release! fixed-in-net8.0-nightly This may be available in a nightly release! labels Aug 2, 2024
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

community ✨ Community Contribution fixed-in-8.0.80 fixed-in-net9.0-nightly This may be available in a nightly release!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android crashes on Modal Animation when backgrounded

3 participants