Path config with `~` on macOS seems to not work

Open
#347 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
react-native, typescript

Research direction

Start with the reproduction's src/Storage.js and confirm the behavior using the path '~/.test' on macOS. Then trace the path configuration and constructor validation in the relevant MMKV entry points. Done means the reported path behavior and the config without an id have clearly defined, tested behavior.

Written by the indexing model from the issue text.

Description

Lately, I have switched from AsyncStorage to MMKV in on of the macOS test projects, and I would like to utilize the path config, but it looks like that, when path includes tilde (~) file is not saved. Not sure if this is intended to work, but I have decided to report this anyway, so feel free to close this one or convert to feature request.

Other thing which was a bit unexpected is that you cannot use the constructor with config object, but without the id field (no fallback to default?), so for example when path and encryption field are the only present, this leads to error about missing ID.

Repro

Dominant language
TypeScript
Stars
8.5k
Forks
347
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from margelo/react-native-mmkv

All issues in margelo/react-native-mmkv

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.