miniflare icon indicating copy to clipboard operation
miniflare copied to clipboard

[BUG] DO storage keys are case-sensitive on the edge, but Miniflare uses case-insensitive key matching with persistence

Open hkochniss opened this issue 2 years ago • 1 comments

Example code (simplified version of what my script is doing), local disk persistence is turned on for DOs:

const key = "foo"
state.storage.put(key, { bar: 1})
const value = await state.storage.get(key.toUpperCase())

Behavior on the edge: value is undefined Behavior in Miniflare: value is { bar: 1 }

Not sure this changes when persistence is turned off, don't assume so

hkochniss avatar Apr 23 '22 11:04 hkochniss

Hey! 👋 Thanks for raising this. I think this is a fundamental issue with how Miniflare's file system storage works on case-insensitive file systems. We'll revisit this in the next major version. 👍

mrbbot avatar May 20 '22 21:05 mrbbot

Hey! 👋 I been thinking about switching out the storage system in Miniflare 3. I've put some thoughts together here: https://github.com/cloudflare/miniflare/discussions/525.

mrbbot avatar Mar 01 '23 12:03 mrbbot

Hey! 👋 This should be fixed in Miniflare 3, which uses the same workerd runtime as production, so shouldn't have these behaviour mismatches.

mrbbot avatar Nov 07 '23 15:11 mrbbot