Fix stale phpMyAdmin assets after Studio updates - #3170
Conversation
The dependency setup compared phpMyAdmin's upstream composer.json version to decide whether to refresh the bundled copy, but that version rarely changes across Studio releases. Playground-specific files injected at build time (e.g. DbiMysqli.php) did change, so user installs kept the stale copy and phpMyAdmin failed to load the SQLite driver. Compare by file size and mtime instead, matching how language packs and AI instructions are refreshed.
📊 Performance Test ResultsComparing efede44 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) |
|
@epeicher, so Studio updated PhpMyAdmin to a new version, but didn't apply its patches because the modification check was too aggressive? |
I followed these steps but for some reason, I was not able to see the error at all. Everything worked for me as expected even before the fix. Are there any specific requirements for the Studio site itself e.g. specific PHP or WordPress versions? |
I think the steps with ZIP export are not enough - you might need to start the site before testing the fix to ensure phpMyAdmin gets updated, but patches are not getting applied. |
|
@katinthehatsite, @wojtekn, I have updated the test instructions, I was able to reproduce it initially, but probably because I had an old version of the The original issue seems to be what Wojtek describes, some files are injected by Playground, and they were ignored in the previous version of the code because the modification check was too aggressive. |
Related issues
How AI was used in this PR
Used Claude to locate the root cause (the bundled phpMyAdmin refresh keyed off
composer.jsonversion), propose the fix (switch to size/mtime comparison, matching sibling asset helpers), and run the test/typecheck/lint loop. I reviewed the diff and verified the fix end-to-end in a running Studio instance before opening the PR.Proposed Changes
composer.jsonversion comparison incopyBundledPhpMyAdminwith a size/mtime directory diff.composer.json"version" (5.2.3) rarely changes, but Studio injects Playground-specific files (e.g.DbiMysqli.php) at build time that do change across Studio releases. The version check was skipping the re-copy, leaving users with stale assets that still hard-codedwp-content/mu-plugins/sqlite-database-integration/wp-pdo-mysql-on-sqlite.php— a path that no longer exists in the current sqlite-database-integration layout.copyBundledLanguagePacksandcopyBundledAiInstructions.Testing Instructions
Prerequisite: Export a Studio site to a
.zipfile and import it to a new site.Before the fix, opening phpMyAdmin for that site shows:
With the fix:
npm run cli:buildnpm startTo simulate the stale state for testing without needing a fresh install, overwrite
~/.studio/server-files/phpmyadmin/libraries/classes/Dbal/DbiMysqli.phpwith an older copy that stillrequire_oncesthe legacy path, for example add the following line to line 26:then, run
npm startin trunk and check you can reproduce the error. Then runnpm starton this branch and check the error disappears when openingphpMyAdmin(remember to force refresh!cmd+shift+R)Pre-merge Checklist