-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
refactor(sqllab): nonblocking new query editor #28795
refactor(sqllab): nonblocking new query editor #28795
Conversation
/testenv up FEATURE_SQLLAB_BACKEND_PERSISTENCE=true |
@justinpark Ephemeral environment spinning up at http://54.202.253.165:8080. Credentials are |
queries, | ||
) { | ||
return function (dispatch) { | ||
export function migrateQueryEditorFromLocalStorage(queryEditor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a migration or you're syncing the query editor state with the backend? If you're syncing the state, could you rename this function to syncQueryEditor
and add a JSDoc explaining that it syncs the values in the local storage with the backend?
@@ -467,7 +467,16 @@ function migrateQuery(queryId, queryEditorId, dispatch) { | |||
); | |||
} | |||
|
|||
export function migrateQueryEditorFromLocalStorage(queryEditor) { | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Ephemeral environment shutdown and build artifacts deleted. |
SUMMARY
Following up #24539
This commit modifies the
addQueryEditor
function to asynchronously handle the process of creating a queryEditor in localStorage in the same way as in non-persistent mode and periodically saving the queryEditor state to persistence via AutoSync'smigrateQueryEditorFromLocalStorage
.This commit made the following changes:
In persistence mode, new tabs can now open and access data directly from localStorage without the delays caused by network or database latency.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
before--nonblocking-creation.mov
After:
after--nonblocking-creation.mov
TESTING INSTRUCTIONS
Set SQLLAB_PERSISTENCE_MODE on and then open a multiple tabs
please reload the page and then check all tabs are persisted
ADDITIONAL INFORMATION