Summary
macSCP saves connections into SwiftData/SQLite, but after rebooting macOS the saved connections disappear from the UI and from the ZCONNECTIONENTITY table.
I confirmed that the data is written before reboot, but it appears to remain in the SQLite WAL file. If I manually run PRAGMA wal_checkpoint(FULL); before rebooting, the data survives the reboot.
Environment
- OS: macOS Sequoia 15.7.7
- Storage observed at:
~/Library/Application Support/default.store
~/Library/Application Support/default.store-wal
~/Library/Application Support/default.store-shm
Steps to Reproduce
- Open macSCP.
- Create a new connection, for example
checkpoint-test.
- Confirm the connection exists:
sqlite3 ~/Library/Application\ Support/default.store \
"select ZNAME,ZHOST,ZUSERNAME from ZCONNECTIONENTITY;"
- Reboot macOS without manually checkpointing.
- After login, before opening macSCP, run:
sqlite3 ~/Library/Application\ Support/default.store \
"select ZNAME,ZHOST,ZUSERNAME from ZCONNECTIONENTITY;"
Actual Result
The connection table is empty after reboot, and macSCP UI shows no saved connections.
Expected Result
Saved connections and folders should persist across macOS reboots.
Additional Findings
Before reboot, the data exists:
sqlite3 ~/Library/Application\ Support/default.store \
"select ZNAME,ZHOST,ZUSERNAME from ZCONNECTIONENTITY;"
The database files show recent writes in the WAL file:
ls -la ~/Library/Application\ Support/default.store*
Manually checkpointing before reboot prevents data loss:
sqlite3 ~/Library/Application\ Support/default.store \
"PRAGMA wal_checkpoint(FULL);"
This returned:
After doing this, rebooting macOS preserves the connection.
Suspected Cause
SwiftData appears to be using the default SQLite store path:
~/Library/Application Support/default.store
~/Library/Application Support/default.store-wal
~/Library/Application Support/default.store-shm
The app does not appear to force a checkpoint or otherwise ensure WAL contents are flushed before macOS reboot.
Also, the store path is not app-specific. It should probably be placed under something like:
~/Library/Application Support/macSCP/macSCP.store
Suggested Fix
- Use an explicit SwiftData store URL under the app's Application Support directory.
- Migrate existing
default.store* files if present.
- Ensure the model context is saved and the SQLite WAL is checkpointed on app quit / scene phase changes / before termination.
Summary
macSCP saves connections into SwiftData/SQLite, but after rebooting macOS the saved connections disappear from the UI and from the
ZCONNECTIONENTITYtable.I confirmed that the data is written before reboot, but it appears to remain in the SQLite WAL file. If I manually run
PRAGMA wal_checkpoint(FULL);before rebooting, the data survives the reboot.Environment
Steps to Reproduce
checkpoint-test.Actual Result
The connection table is empty after reboot, and macSCP UI shows no saved connections.
Expected Result
Saved connections and folders should persist across macOS reboots.
Additional Findings
Before reboot, the data exists:
The database files show recent writes in the WAL file:
Manually checkpointing before reboot prevents data loss:
This returned:
After doing this, rebooting macOS preserves the connection.
Suspected Cause
SwiftData appears to be using the default SQLite store path:
The app does not appear to force a checkpoint or otherwise ensure WAL contents are flushed before macOS reboot.
Also, the store path is not app-specific. It should probably be placed under something like:
Suggested Fix
default.store*files if present.