jonataslaw / get_storage

A fast, extra light and synchronous key-value storage to Get framework
MIT License
359 stars 82 forks source link

get_storage not saving data when key starts with underscore (_), private variable not saved by get_storage #146

Closed vijaybheda closed 4 months ago

vijaybheda commented 4 months ago

I have encountered an issue where get_storage does not save data when the key starts with an underscore (_). This appears to be a problem specifically with keys that are intended to be private variables. When attempting to save such data, it does not get stored, and retrieving the data later results in a null value.

Steps to Reproduce:

  1. Initialize get_storage.
  2. Try to save data with a key that starts with an underscore, e.g., _privateKey.
  3. Attempt to retrieve the data using the same key.

Expected Behavior: The data should be saved and retrievable using the key that starts with an underscore.

Actual Behavior: The data is not saved, and retrieval returns null.

Code Example:

final box = GetStorage();
await box.write('_privateKey', 'someValue');
final value = box.read('_privateKey');
print(value); // Expected output: 'someValue', Actual output: null

Environment:

Additional Information: Please let me know if you need any further information or if there are any workarounds for this issue.

Thank you!