Bugfix/do not use persisted when update never #57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is This?
This is a continuation of the discussion we had on Slack yesterday related to NStack and what to do when you
.neverwant to update your translations.The problem seemed to be that we always automatically always go straight for the persisted data first in
createLocalizationObjectbefore we attempt a fallback to the JSON file with translations in the app.This works fine if you automatically fetch and save/persist new content from NStack but it doesn't catch new updates if you insist on
.neverupdating your translations. That means that if you add new translations to the JSON file, they won't be detected since the old/persisted data is used...and that doesn't contain the new translations.The Fix
So...this is part of a two step rocket. One part here and one in the NStackSDK project.
In this project we now allow outsiders (that means you NStackSDK) to say "you know what...I don't want to look up the
lookupPersistedLocalizationsfirst, lemme go straight to the JSON file".This property has a default value of true to minimize the damage in code already using the function.
With that in place, we can now use this from the NStackSDK to actually skip looking for persisted data...but that is the topic for a future PR in that repo 😄
Furthermore
I "fixed" some of the failing tests (15 out of 33 tests were failing in the
developbranch before I touched anything 😊 )Still have 3 failing test but I'm too stupid to fix them so....knock yourself out guys 😄