Debugging a SQLite WASM Heap Fragmentation Bug in a VS Code Extension

While building AS Notes (A wikilink-based knowledge management VS Code extension - https://github.com/appsoftwareltd/as-notes) - I ran into a subtle and genuinely interesting bug involving WebAssembly...