Skip to content

Ensure worspaces/pgadmin state is saved on abrupt shutdown of pgadmin.#GH_3319 #8671

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

yogeshmahajan-1903
Copy link
Contributor

No description provided.

@yogeshmahajan-1903 yogeshmahajan-1903 force-pushed the GH_3319 branch 5 times, most recently from ae9bd5f to 7441c9e Compare April 22, 2025 09:58
@yogeshmahajan-1903 yogeshmahajan-1903 force-pushed the GH_3319 branch 7 times, most recently from c2980a1 to 2b23a35 Compare May 6, 2025 05:56
Copy link
Contributor

@akshay-joshi akshay-joshi left a comment

Choose a reason for hiding this comment

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

GUI Review Comments:

  1. When opening pgAdmin again in the browser Default Workspace should be in focus. Open Schema Diff tool and refresh the browser.

  2. PSQL tools database name not showing in the single line on reopening pgAdmin.

  3. Delete all the states from the table if the user changes the preferences and sets them to False.

  4. Getting error AttributeError: 'NoneType' object has no attribute 'connection' in line 604, in _get_database_role psql/init.py

  5. params['db'] = underscore_escape(data['db_name'])  TypeError: 'NoneType' object is not subscriptable in line 104 in psql/init.py

  6. Open Query Tool/PSQL in the respective workspace and then refresh the browser. It opens in the Default workspace, which seems to be correct, but we need to document this behaviour.

  7. Query Tool/PSQL for adHoc servers are still opening with error. We should not store state of the adHoc server.

  8. The show_query_tool.js, show_erd_tool.js, showSchemaDiffTool.js and show_psql_tool.js files have duplicate code to open the respective tools. We can easily make some part of the logic generic.

  9. Why file name 'showSchemaDiffTool.js' different in respect to others like show_query_tool.js

  10. Documentation/Screenshot updates are missing for Preferences.

  11. Create a new .rst file to explain this new feature.

  12. Add comments in the new function added in this PR and wherever needed in the code, so that others can understand the logic.

Copy link
Contributor

@adityatoshniwal adityatoshniwal left a comment

Choose a reason for hiding this comment

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

Have we handled the case where a server is removed?

Copy link
Contributor

@adityatoshniwal adityatoshniwal left a comment

Choose a reason for hiding this comment

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

Last time I had asked if the connection was removed. Open query tool, disconnect server, remove the server and close the query tool.
Also, what happens to open files?

@yogeshmahajan-1903 yogeshmahajan-1903 force-pushed the GH_3319 branch 3 times, most recently from f9245e4 to e318d8c Compare May 16, 2025 04:12
@yogeshmahajan-1903 yogeshmahajan-1903 force-pushed the GH_3319 branch 2 times, most recently from e7ec379 to fbb8c28 Compare May 21, 2025 05:51
connection_info = data['connection_info'] \
if 'connection_info' in data else None
if 'open_file_name' in connection_info and connection_info['open_file_name'] and 'is_editor_dirty' in connection_info and connection_info['is_editor_dirty']:
last_saved_file_hash = compute_sha256_large_file(connection_info['open_file_name'])
Copy link
Contributor

Choose a reason for hiding this comment

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

How will this work in server mode? I mean the path structure is different on server mode.

@@ -56,6 +59,18 @@ export default function ToolView({dockerObj}) {
// Handler here will return which layout instance the tool should go in
// case of workspace layout.
let handler = pgAdmin.Browser.getDockerHandler?.(panelId, dockerObj);
const deregisterRemove = handler.docker.eventBus.registerListener(LAYOUT_EVENTS.REMOVE, (closePanelId)=>{
Copy link
Contributor

Choose a reason for hiding this comment

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

lets move the callback to appstateprovider file.

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.

3 participants