Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Assigning conf.store overrides applied migrations #114

Open
ixrock opened this issue Jul 5, 2020 · 3 comments
Open

[BUG] Assigning conf.store overrides applied migrations #114

ixrock opened this issue Jul 5, 2020 · 3 comments

Comments

@ixrock
Copy link

ixrock commented Jul 5, 2020

package.json
"conf": "^7.0.1",

Example:

import Config from "conf"

const config = new Config({
 migrations: {
    "2.0.0": store => store.set("lastSeenVersion", "2.0.0")
  }
})
config.store = {newData: "blabla"} // this will destroy marked migration in __internal__
@sindresorhus
Copy link
Owner

// @rafaelramalho19 In case you have time/interest in looking into this. If not, no worries.

@willium
Copy link

willium commented Jan 11, 2021

Was this resolved? Seems tricky.

willium added a commit to willium/conf that referenced this issue Jan 11, 2021
The internal key causes some problems, both during write (sindresorhus#114) and at read (can't trust MyStore.keys() or MyStore.values() without omitting __internal__). We should at least export the variable so the client can manually omit it (and at best, provide a more ergonomic pattern—perhaps a WeakMap?)
@sindresorhus
Copy link
Owner

If anyone wants to work on this, see the initial attempt and feedback in: #137

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants