Skip to content

fix(connections): removing a folder keeps its connections - #1267

Merged
ZhuchkaTriplesix merged 2 commits into
devfrom
fix/folder-removal-keeps-connections
Oct 10, 2026
Merged

ZhuchkaTriplesix merged 2 commits into
devfrom
fix/folder-removal-keeps-connections

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

Replaces the behaviour #1266 made visible: removing a folder no longer deletes its connections; they stay in the list without a folder.

Why this way: connections.folder_id is ON DELETE CASCADE. Changing it to SET NULL means rebuilding the connections table in SQLite (a migration of the user's main table). Instead, LocalDb.removeFolder sets folder_id = NULL on the folder's connections and deletes the folder in one transaction. The cascade then finds nothing. No schema change, no migration, nothing to roll back.

Removed, as nothing is destroyed any more: the confirmation dialog and the secret cleanup from #1266.

Tests: connections of the removed folder survive with folder_id null and keep their password in the secure store; another folder's connections are untouched; removing an empty or unknown folder is harmless.

Existing databases are unaffected; the old cascade stays in the schema but is never triggered through the app.

Test plan

  • CI: all test sections pass (no local runs, per team rule)

connections.folder_id cascades on delete, so removing a folder deleted the
connections in it. They are detached (folder_id = NULL) in the same
transaction before the folder row goes, so the cascade finds nothing. No
schema migration: the foreign key stays as it is.

The confirmation dialog and the secret cleanup of the previous change are
gone: nothing is deleted any more.
The sidebar reloads from the database after the save; checking once raced
it. The URI scenarios already waited.
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 69346fc into dev Oct 10, 2026
13 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the fix/folder-removal-keeps-connections branch October 11, 2026 15:02
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