Skip to content

cache state, only recreate when new resource is set (#613) #624

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

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

adietish
Copy link
Collaborator

@adietish adietish commented Jun 30, 2023

fixes #613

@adietish adietish self-assigned this Jun 30, 2023
@adietish adietish force-pushed the issue-613 branch 2 times, most recently from c9fa25c to bb252d0 Compare June 30, 2023 16:21
@adietish adietish requested a review from sbouchet June 30, 2023 16:21
@adietish
Copy link
Collaborator Author

adietish commented Jun 30, 2023

@sbouchet: The problem statement is in #613 (comment).

The fix is as follows:
We should only create the EditorResourceState for an EditorResource when the EditorResource is created or when the EditorResource gets a new resource. Any other time the state is retrieved (EditorResource#getState) a cached state should be returned.
Creating EditorResource(s)/Setting new resource(s) to existing EditorResource(s) is executed in a background thread, calling EditorResource#getState may be called in the UI thread (and actually is when PushNotification#show is run).

Please review.

@adietish adietish marked this pull request as ready for review June 30, 2023 16:45
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.8% 0.8% Duplication

Copy link
Collaborator

@sbouchet sbouchet left a comment

Choose a reason for hiding this comment

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

LGTM. no more freeze on the editor when using devsandbox.

@adietish adietish merged commit cf0da15 into redhat-developer:main Jul 4, 2023
@adietish adietish deleted the issue-613 branch July 4, 2023 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When using sandbox the editor is freezing for a few seconds on startup
2 participants