-
Notifications
You must be signed in to change notification settings - Fork 1
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
#100 - Bug/local storage version control - Fikret Ellek #116
Conversation
I would suggest we should use semantic versioning https://semver.org/ and behave appropriately. So if you add a new field which has a sensible default, then you don't throw away existing data, but if there is a breaking change you do throw away existing data. |
… storage doesn't get deleted
I'm not convinced this new version implements semantic versioning. Where is the "major version changed, ignore old: minor version change, try to merge: tiny version changed try to ignore" ?? |
OK this is a ChatGPT quickie, but it's about right I think: const fs = require('fs'); function readVersionedJson(filePath, requiredVersion) {
} catch (error) { function applyDefaultUpgrades(jsonData, targetVersion) { // Example Usage const data = readVersionedJson(filePath, requiredVersion); |
…s differently. Created subfunctionalities to support semantic versioning.
That last commit looks as though it should do the job. How confident are you? Sufficiently confident not to have some tests? |
… to get newVersion as parameter as well
Naming Rules
Name your PR like this: ISSUENUMBER-TITLE-YOURNAME
Description
I have created service functions for getting and setting meeting local storage data. Within this implementation we ensure that local storage updates need to be handled with version control.
Related to
Make sure you include the issue number with a hash sign # so Github can link this PR to the right issue, like this:
Fixes #100
Checklist: