Fix sync pull getting stuck when site has broken SQLite integration#3008
Fix sync pull getting stuck when site has broken SQLite integration#3008
Conversation
📊 Performance Test ResultsComparing ffdb940 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
There was a problem hiding this comment.
- Create a new Studio site and connect it to a WordPress.com site via Sync
- Pull the site to confirm it works normally
I tested two times - it doesn't work for me.
The steps:
nvm usenpm inpm run cli:build- Create a new wpcom site
- Created a new Studio site
- Connected and pulled
No errors in Studio, only "Import failed".
In Logs:
#13 phar:///tmp/wp-cli.phar/vendor/wp-cli/wp-cli/php/wp-cli.php(35): WP_CLI\bootstrap()
#14 phar:///tmp/wp-cli.phar/php/boot-phar.php(20): include('phar:///tmp/wp-...')
#15 /tmp/wp-cli.phar(4): include('phar:///tmp/wp-...')
#16 {main}
thrown in /tmp/sqlite-command/src/SQLiteDatabaseIntegrationLoader.php on line 86
at JetpackImporter.importDatabase (/Users/nightneia8c/projects/a8c/studio/apps/studio/dist/main/index.js:27637:17)
at async JetpackImporter.import (/Users/nightneia8c/projects/a8c/studio/apps/studio/dist/main/index.js:27677:9)
at async importBackup (/Users/nightneia8c/projects/a8c/studio/apps/studio/dist/main/index.js:29366:12)
at async importSite (/Users/nightneia8c/projects/a8c/studio/apps/studio/dist/main/index.js:44688:20)
at async Session.<anonymous> (node:electron/js2c/browser_init:2:116791)
|
thanks for the review @nightnei |
|
@bcotrim yeah, it fails for my on trunk too. I will continue testing when Automattic/wp-cli-sqlite-command#24 is merged, ok? |
Sounds great, thanks for checking! |
|
Automattic/wp-cli-sqlite-command#24 is merged now |
Related issues
How AI was used in this PR
Claude Code was used to explore the codebase, trace the sync pull flow, identify root causes, and implement the fix. All changes were manually tested by reproducing the bug (replacing
wp-contentwith a symlink) and verifying the pull completes successfully after the fix.Proposed Changes
wp-contentis replaced (e.g., with a symlink to a repo), the SQLite files (db.php,mu-plugins/sqlite-database-integration,database/) are lost. TheimportSitehandler now checkshasSQLitePlugin()and reinstalls the integration if missing, so the database import can succeed.importSite()threw during a sync pull,startServer()was never called, leaving the site stopped and unreachable. The import is now wrapped intry/finallyso the server always restarts.installSqliteIntegrationfromsqlite-versions.tsto allow force-installing SQLite integration bypassing theneedsSqliteSetupcheck, which incorrectly skips installation whenwp-config.phpexists butdb.phpdoesn't.Testing Instructions
wp-contentfolder with a symlink to an empty directory (e.g.,mv wp-content wp-content-backup && ln -s /tmp/some-dir wp-content)Pre-merge Checklist