Skip to content

Commit

Permalink
Workaround broken prefix filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonKearl committed Aug 7, 2023
1 parent 4abc194 commit 4aca7bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ Note: wrangler must be installed and logged into for this extension to work.
## Known Issues

- Local mode does not properly render JSON as a parsed value. [View Bug](https://github.com/cloudflare/workers-sdk/issues/3715)
- Local mode does not properly respect prefix filtering. [View Bug](https://github.com/cloudflare/workers-sdk/issues/3716)
4 changes: 4 additions & 0 deletions src/wrangler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ export const list = async (

const data: ListResponseDatum[] = []
for (const datum of Array.isArray(rawData) ? rawData : rawData.keys) {
if (!datum.name.startsWith(opts.prefix)) {
console.error("List error: invalid prefix matching", { opts, datum })
continue
}
metadataCache.set(
getCacheKey(opts.namespace, datum.name),
JSON.stringify(datum.metadata),
Expand Down

0 comments on commit 4aca7bd

Please sign in to comment.