invertase/dart_edge

Error while accessing empty KV keys

Closed this issue ยท 4 comments

While accessing non existing kv keys, currently it's throwing an error.
Unhandled Promise Rejection: Error: TypeError: null: type 'JSNull' is not a subtype of type 'FutureOr<String>'

I'm no expert in these, but a better idea would be to make the return type of get from kvNamespace from Future<String> to Future<String?> . Then we can check if the key exists by checking if the value is null.

Ehesp commented

Ah thanks, I'll sort that. Still trying to figure out how to properly test everything ๐Ÿ˜…

Thank you for the fast response!

Ehesp commented

Should be fixed here f1dba99 and in 0.0.2+2

Ehesp commented

Figured out a testing flow now sorted will be able to test everything ๐Ÿ‘