Skip to content

Revert "Update SQLite database path (#3428)"#3435

Merged
JanJakes merged 1 commit intotrunkfrom
revert-sqlite-path
Mar 25, 2026
Merged

Revert "Update SQLite database path (#3428)"#3435
JanJakes merged 1 commit intotrunkfrom
revert-sqlite-path

Conversation

@JanJakes
Copy link
Copy Markdown
Member

@JanJakes JanJakes commented Mar 25, 2026

Summary

This reverts #3428.

🤖 Generated with Claude Code

@JanJakes JanJakes requested review from a team, brandonpayton and Copilot March 25, 2026 17:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 in packages/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.

Comment on lines 315 to +327
@@ -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 });
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines 551 to +563
@@ -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 });
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
entry.path.endsWith('/.ht.sqlite.php') ||
entry.path.endsWith('/.ht.sqlite.php-journal') ||
entry.path.endsWith('/.ht.sqlite') ||
entry.path.endsWith('/.ht.sqlite-journal')
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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')

Copilot uses AI. Check for mistakes.
![Export button](@site/static/img/site-manager/export-zip-file.webp)

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."
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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."

Copilot uses AI. Check for mistakes.
@JanJakes JanJakes force-pushed the revert-sqlite-path branch from a747937 to 1f9a42c Compare March 25, 2026 17:57
@JanJakes
Copy link
Copy Markdown
Member Author

All green, let's get it in.

@JanJakes JanJakes merged commit e1d488b into trunk Mar 25, 2026
47 checks passed
@JanJakes JanJakes deleted the revert-sqlite-path branch March 25, 2026 18:33
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.

2 participants