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

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

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

adietish
Copy link
Collaborator

@adietish adietish commented Jun 30, 2023

fixes #613

@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
@sonarcloud
Copy link

sonarcloud bot commented Jun 30, 2023

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
Contributor

@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
14 checks passed
@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