DEV Community

Ekong Ikpe
Ekong Ikpe

Posted on

I Accidentally Wrote a Filesystem Driver. For a Browser. πŸ€”

Staring at a bug report that makes no sense.

Data gone. No error. No warning. No stack trace. Just… gone.

Your app writing files using the File System Access API β€” which, by the way, is genuinely one of the most exciting things that's happened to the browser in years. A user picks a folder. You write to it. Clean, native, no server involved. The dream, right?

Except on mobile, the dream has a bad habit of dying quietly.


Here's what was actually happening

The browser process got killed in the background. Completely normal β€” Android does this all the time when memory gets tight. Writable stream was mid-write when it happened.

No error was thrown. The write just… didn't complete.

And then you start digging. And you realize β€” this isn't a bug you can patch. It was a category of problem.

  • The OS kills your process β†’ your in-flight write disappears
  • You reopen the app β†’ your file handle is stale
  • You fire ten writes at once β†’ the File System Access API doesn't serialize them, so they race, collide, and most of them silently fail

Three completely different failure modes. All silent. All data loss.

I fixed them. I wrote a write-ahead buffer, a per-filename queue, an IndexedDB fallback shelf, and a recovery mechanism that replays shelved writes on next wake.

And then I looked at what I'd built and thought…

wait.


This isn't a web feature. This is a kernel problem.

Write ordering. Process lifecycle. I/O durability. Recovery after crash.

These aren't things you solve in web apps. These are things you solve in operating systems.

Which made me ask a question I couldn't stop thinking about: why did I hit OS-level problems inside a browser?

The uncomfortable answer: because the browser is already an OS.

Not metaphorically. Not "kind of." Actually.

It has a process manager (tab lifecycle, background kill policies).
It has a filesystem (File System Access API, Origin Private File System).
It has persistent storage (IndexedDB, Cache API).
It has a network stack (fetch, WebSockets, WebRTC).
It has a GPU interface (WebGPU).
It has a concurrency model (Web Workers, SharedArrayBuffer).
It can even run compiled binaries (WebAssembly).

That's not a list of "web features." That's a kernel feature set. 😳


And yet… we're still building like it's 2010

Most frameworks still treat the browser like a dumb UI layer sitting on top of a real backend. State lives on a server. Files live on a server. Compute lives on a server. The browser is just the face.

But the platform has quietly moved on.

The browser isn't asking your server for permission anymore. It's got its own filesystem. Its own persistent storage. Its own compute pipeline. Its own process isolation.

We just haven't caught up to what it actually is.


What developers are building instead

Here's the thing that gets me. πŸ€”

Look at Electron. Look at Tauri. Look at Capacitor. Look at every "make a web app feel native" framework that's shipped in the last decade.

What are they all doing? They're wrapping the browser. Giving it a launcher. Giving it a system tray icon. Giving it access to APIs it wasn't "supposed" to have.

They're building a skin. A controlled launcher for a runtime that already had the OS capabilities β€” it just hadn't admitted it yet.

The browser doesn't need a wrapper to be an OS. It is one. The wrappers exist because we haven't fully accepted that yet.


The moment it clicked for me

When I finished gnoke-savenative β€” my little durability layer for mobile browser writes β€” I described the architecture to a friend.

Write-ahead buffer. Fallback shelf. Replay on wake. That's WAL. Write-Ahead Logging. The same durability primitive PostgreSQL uses to survive crashes. Implemented inside a browser tab.

That's not a web developer problem. That's a systems programming problem.

And I solved it inside a browser tab.


So what does this mean practically?

I think we're in a weird transitional moment. The browser runtime is already powerful enough to be treated as a first-class OS β€” but most developers are still building on top of it like it's a view layer.

The ones who figure this out first get to build the system services. The filesystem drivers. The process managers. The things that sit below the app layer and make everything else reliable.

That's where I'm going with the Gnoke Suite. Not apps that run in a browser. A system layer that runs as the browser.

It's a subtle difference. But I think it changes everything about how you architect what you build. 🧠


If you want to see what a browser filesystem driver actually looks like in practice:

πŸ‘‰ gnoke-savenative on GitHub

And if you've hit similar problems β€” silent write failures, stale handles, mobile process kills β€” I'd genuinely love to hear about it in the comments. I have a feeling more people have run into this than have written about it.

β€” Edmund Sparrow, Gnoke Suite

Top comments (1)

Collapse
 
edmundsparrow profile image
Ekong Ikpe

dev.to/sylwia-lask/9-things-youre-...

dev.to/sylwia-lask/why-webgpu-feel...

Writing style on this one was inspired by @sylwia-lask β€” her posts on dev.to are worth your time.