Revert "Update SQLite database path (#3428)"#3435
Conversation
There was a problem hiding this comment.
Pull request overview
Reverts the SQLite database file path change from wp-content/database/.ht.sqlite.php back to wp-content/database/.ht.sqlite across Playground packages, tooling, tests, and documentation.
Changes:
- Updated hardcoded DB paths and OPFS “Playground directory” detection to use
.ht.sqlite. - Updated Adminer/phpMyAdmin SQLite DSNs and sync filtering rules.
- Updated docs and tests to reflect the reverted DB filename.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/playground/wordpress/src/test/database.spec.ts | Updates test config DB path to .ht.sqlite. |
| packages/playground/wordpress-builds/public/wp-6.3/wordpress-remote-asset-paths | Updates remote asset list entry for the DB file name. |
| packages/playground/website/src/lib/state/redux/boot-site-client.ts | Updates OPFS detection to look for .ht.sqlite. |
| packages/playground/website/src/components/site-manager/site-database-panel/index.tsx | Updates displayed/downloaded DB path constant. |
| packages/playground/website/src/components/site-manager/site-database-panel/download-button.tsx | Updates download DB path constant. |
| packages/playground/website/src/components/site-manager/site-database-panel/adminer-extensions/adminer-mysql-on-sqlite-driver.php | Updates SQLite PDO DSN path. |
| packages/playground/website/playwright/e2e/website-ui.spec.ts | Updates UI assertion to the new DB filename. |
| packages/playground/tools/src/phpmyadmin/DbiMysqli.php | Updates SQLite PDO DSN path. |
| packages/playground/sync/src/fs.ts | Removes legacy .ht.sqlite.php* filtering; keeps .ht.sqlite*. |
| packages/playground/personal-wp/src/lib/state/redux/boot-site-client.ts | Updates OPFS detection to look for .ht.sqlite. |
| packages/playground/personal-wp/src/components/site-manager/site-database-panel/index.tsx | Updates displayed/downloaded DB path constant. |
| packages/playground/personal-wp/src/components/site-manager/site-database-panel/download-button.tsx | Updates download DB path constant. |
| packages/playground/personal-wp/src/components/site-manager/site-database-panel/adminer-extensions/adminer-mysql-on-sqlite-driver.php | Updates SQLite PDO DSN path. |
| packages/docs/site/i18n/tl/docusaurus-plugin-content-docs/current/main/quick-start-guide.md | Updates referenced DB filename in localized docs. |
| packages/docs/site/i18n/pt-BR/docusaurus-plugin-content-docs/current/main/quick-start-guide.md | Updates referenced DB filename in localized docs. |
| packages/docs/site/i18n/pt-BR/docusaurus-plugin-content-docs/current/developers/05-local-development/04-wp-playground-cli.md | Updates referenced DB filename in localized CLI docs. |
| packages/docs/site/i18n/ja/docusaurus-plugin-content-docs/current/main/quick-start-guide.md | Updates referenced DB filename in localized docs. |
| packages/docs/site/i18n/ja/docusaurus-plugin-content-docs/current/developers/05-local-development/04-wp-playground-cli.md | Updates referenced DB filename in localized CLI docs. |
| packages/docs/site/i18n/gu/docusaurus-plugin-content-docs/current/main/quick-start-guide.md | Updates referenced DB filename in localized docs. |
| packages/docs/site/i18n/fr/docusaurus-plugin-content-docs/current/main/quick-start-guide.md | Updates referenced DB filename in localized docs. |
| packages/docs/site/i18n/es/docusaurus-plugin-content-docs/current/main/quick-start-guide.md | Updates referenced DB filename in localized docs. |
| packages/docs/site/i18n/es/docusaurus-plugin-content-docs/current/developers/05-local-development/04-wp-playground-cli.md | Updates referenced DB filename in localized CLI docs. |
| packages/docs/site/i18n/bn/docusaurus-plugin-content-docs/current/main/quick-start-guide.md | Updates referenced DB filename in localized docs. |
| packages/docs/site/docs/main/quick-start-guide.md | Updates referenced DB filename in main docs. |
| packages/docs/site/docs/developers/05-local-development/04-wp-playground-cli.md | Updates referenced DB filename in main CLI docs. |
Comments suppressed due to low confidence (1)
packages/playground/website/src/components/site-manager/site-database-panel/download-button.tsx:1
- Hardcoding the new DB path will make download fail for sites whose DB file is still named
.ht.sqlite.php(e.g., created with the reverted change). A safer approach is to probe both paths (prefer.ht.sqlite, fall back to.ht.sqlite.php) and use whichever exists. The same pattern applies to the analogous file inpackages/playground/personal-wp/.../download-button.tsx.
import { Button, Icon, Flex, FlexItem } from '@wordpress/components';
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -324,7 +324,7 @@ export async function playgroundAvailableInOpfs( | |||
| const database = await wpContent.getDirectoryHandle('database', { | |||
| create: false, | |||
| }); | |||
| await database.getFileHandle('.ht.sqlite.php', { create: false }); | |||
| await database.getFileHandle('.ht.sqlite', { create: false }); | |||
There was a problem hiding this comment.
This switches OPFS Playground detection to require .ht.sqlite and will fail to detect existing persisted sites created when the DB file was .ht.sqlite.php. To avoid stranding users during the transition/revert, check for either filename (try .ht.sqlite, then fall back to .ht.sqlite.php) before returning false.
| @@ -560,7 +560,7 @@ export async function playgroundAvailableInOpfs( | |||
| const database = await wpContent.getDirectoryHandle('database', { | |||
| create: false, | |||
| }); | |||
| await database.getFileHandle('.ht.sqlite.php', { create: false }); | |||
| await database.getFileHandle('.ht.sqlite', { create: false }); | |||
There was a problem hiding this comment.
Same compatibility issue as the website package: OPFS detection now only looks for .ht.sqlite and will miss existing sites that still have .ht.sqlite.php. Consider accepting both filenames (new + legacy) during the transition.
| entry.path.endsWith('/.ht.sqlite.php') || | ||
| entry.path.endsWith('/.ht.sqlite.php-journal') || | ||
| entry.path.endsWith('/.ht.sqlite') || | ||
| entry.path.endsWith('/.ht.sqlite-journal') |
There was a problem hiding this comment.
This removes filtering for legacy .ht.sqlite.php and .ht.sqlite.php-journal. If any existing sites/files still use the legacy name, their DB updates may start getting journaled/synced unexpectedly (potentially large/noisy). Consider keeping the legacy suffix checks for backward compatibility until migration is complete; optionally also consider SQLite -wal/-shm sidecar files if WAL mode is used.
| entry.path.endsWith('/.ht.sqlite-journal') | |
| entry.path.endsWith('/.ht.sqlite-journal') || | |
| entry.path.endsWith('/.ht.sqlite.php') || | |
| entry.path.endsWith('/.ht.sqlite.php-journal') || | |
| entry.path.endsWith('/.ht.sqlite-wal') || | |
| entry.path.endsWith('/.ht.sqlite-shm') || | |
| entry.path.endsWith('/.ht.sqlite.php-wal') || | |
| entry.path.endsWith('/.ht.sqlite.php-shm') |
|  | ||
|
|
||
| Ang na-export na file ay naglalaman ng buong site na iyong binuo, kasama ang database (`wp-content/database/.ht.sqlite.php`). Tandaan na ang mga nak начин ng tuldok ay nakatago, kaya maaaring kailangan mong i-enable ang "Show hidden files." | ||
| Ang na-export na file ay naglalaman ng buong site na iyong binuo, kasama ang database (`wp-content/database/.ht.sqlite`). Tandaan na ang mga nak начин ng tuldok ay nakatago, kaya maaaring kailangan mong i-enable ang "Show hidden files." |
There was a problem hiding this comment.
The Tagalog text contains garbled/mixed-script characters (nak начин), which reads like an encoding/translation artifact. Please replace with the correct Tagalog phrase (and/or re-sync the translation) so the sentence is understandable.
| Ang na-export na file ay naglalaman ng buong site na iyong binuo, kasama ang database (`wp-content/database/.ht.sqlite`). Tandaan na ang mga nak начин ng tuldok ay nakatago, kaya maaaring kailangan mong i-enable ang "Show hidden files." | |
| Ang na-export na file ay naglalaman ng buong site na iyong binuo, kasama ang database (`wp-content/database/.ht.sqlite`). Tandaan na ang mga file na nagsisimula sa tuldok ay nakatago, kaya maaaring kailangan mong i-enable ang "Show hidden files." |
This reverts commit 4a159a9.
a747937 to
1f9a42c
Compare
|
All green, let's get it in. |
Summary
This reverts #3428.
🤖 Generated with Claude Code