Skip to content

fix: remove redundant async dispatch, guard switchDatabase result#535

Merged
datlechin merged 1 commit intomainfrom
fix/critical-audit-items
Mar 31, 2026
Merged

fix: remove redundant async dispatch, guard switchDatabase result#535
datlechin merged 1 commit intomainfrom
fix/critical-audit-items

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

  • RightPanelState.isPresented didSet — removed redundant DispatchQueue.main.async { [self] in ... }. The didSet already runs on @MainActor, so the async dispatch was unnecessary and created a brief strong self-capture.
  • DatabaseManager.switchDatabase — replaced try? with do/catch. Previously, if restoring the saved database failed, currentDatabase was set to the saved value anyway, making the UI show a database the connection wasn't actually on. Now only updates currentDatabase on success and logs the failure.

Test plan

  • Toggle right panel open/close — verify state persists across app launches
  • Connect to MSSQL with a saved last-database — verify database restores correctly
  • Connect to MSSQL with a deleted/renamed saved database — verify graceful fallback (default database shown, warning logged)

@datlechin datlechin merged commit 3d956f3 into main Mar 31, 2026
2 checks passed
@datlechin datlechin deleted the fix/critical-audit-items branch March 31, 2026 07:34
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.

1 participant