Introduction#
Hello everyone,
How are you? Welcome to my blog. In this post, I will talk about Futtun’s progress update, from Monday 11 May 2026 to today, Sunday 17 May 2026.
Migrated from WebdriverIO to Playwright for browser tests#
All of a sudden, Futtun’s browser tests could not load due to an error. It may have happened because I updated some dependencies, even though none of them were related to Vitest. I tried troubleshooting the issue, to no avail, so I started investigating moving to Playwright.
The main reason I was using WebdriverIO is because there are issues running Firefox on Linux. After some searching, I found the relevant settings I had to give Vitest for Firefox to work:
// more stuff here...
browser: {
enabled: true,
headless: true,
instances: [
// ...I have omitted chrome's configuration...
{
// I cannot use the locally installed Firefox, I must let playwright
// download and use its own version because it relies on patches.
browser: 'firefox',
provider: playwright({
launchOptions: {
args: ['--no-sandbox'],
env: {
// Necessary because I am on Linux, and without it the browser
// cannot start due to an error related to dbus.
MOZ_DBUS_REMOTE: '0',
},
firefoxUserPrefs: {
'media.navigator.streams.fake': true,
'media.navigator.permission.disabled': true,
},
},
})
}
],
},Unfortunately, Playwright needs a patched version of Firefox to run on Linux. I am forced to use their own, rather than the one I already have installed on my machine.
Improve how I clear the database#
This became necessary because I was working on parsing the Futtun audit file the user uploaded to Futtun.
Previously, the logic was just clearing the database’s tables of their data. However, each table has an auto-incrementing id counter, and this was not reset. Let’s say your last thought in the database has 17 as its id. After the logic to clear the database runs, you want to create a new thought. Its id is 18, rather than 1, because said counter was never reset.
This is now problematic because, when parsing the audit file, the thoughts recorded inside it already have an id assigned to them. The first thought you created has 1 as the id. When you updated it, the logic goes and looks for it, but the same thought now has 18 as the id. To fix this, I need to reset that auto-incrementing id counter, and the only way I have found is by deleting and re-creating the database.
But, to delete the database, all connections to it must first be closed. You may be tempted to think that that doing something along the lines of
// db is the constant that represents your database
db.close();would be enough. Unfortunately not, because it only closes that specific connection. If there are other connections open, deleting the database with
indexedDB.deleteDatabase("DATABASE_NAME");would fail with a blocked status. The solution is to have the onversionchange callback set up like so wherever you open new database connections:
// Close stale connections when another caller requests a delete/upgrade.
db.onversionchange = () => {
db.close();
};After all of this, deleting the database succeeds. I then need to re-create it, thus having a fresh auto-incrementing id counter, and importing your audit file succeeds.
Allow users to upload their Futtun audit file#
At long last, after being able to download your Futtun audit file back, you can now upload it back to Futtun. Doing so deletes your current data, and recreates what is saved in the audit file.
Also, I was wrong when I said I needed logic to avoid performing the auditing part (last week, update number 19). My idea was to re-use the audit file, but that would have been impractical. It is better to parse the file and re-create the same audit actions.
Dependency updates#
With Futtun being an Internet facing application, I will now need to keep on top of updating its dependencies for as long as I will keep Futtun available.
Conclusion#
Thank you for your time, and I hope to see you again soon. Bye bye.