Skip to content

Fixes an issue for which changes to Bundles are not saved#5439

Merged
yair100 merged 3 commits intofiles-community:mainfrom
gave92:issue_5255
Jul 18, 2021
Merged

Fixes an issue for which changes to Bundles are not saved#5439
yair100 merged 3 commits intofiles-community:mainfrom
gave92:issue_5255

Conversation

@gave92
Copy link
Member

@gave92 gave92 commented Jul 17, 2021

Resolved / Related Issues
Items resolved / related issues by this PR.

Validation
How did you test these changes?

  • Built and ran the app

@gave92 gave92 added the ready for review Pull requests that are ready for review label Jul 17, 2021
@d2dyno1
Copy link
Member

d2dyno1 commented Jul 17, 2021

Hmm.. Is the caching here causing Bundles not to be saved? If so, you can pass false to the constructor to disable it

@gave92
Copy link
Member Author

gave92 commented Jul 17, 2021

It's sort of related to caching, I went for this solution since it leaves caching enabled when reading a setting (which is the important part).

The actual problem is the following:

Dictionary<string, List<string>> allBundles = BundlesSettings.SavedBundles;
allBundles[ParentBundleName].Remove(Path);
BundlesSettings.SavedBundles = allBundles;

allBundles and BundlesSettings.SavedBundles point to the same object (the cached setting) so when you check if the setting has changed before saving, the new value is always identical to the current value.

@yair100 yair100 requested a review from winston-de July 18, 2021 04:11
@yair100 yair100 added ready to merge Pull requests that are approved and ready to merge and removed ready for review Pull requests that are ready for review labels Jul 18, 2021
@yair100
Copy link
Member

yair100 commented Jul 18, 2021

@gave92 thank you!

@yair100 yair100 merged commit 746a9b2 into files-community:main Jul 18, 2021
@yair100 yair100 mentioned this pull request Jul 18, 2021
@gave92 gave92 deleted the issue_5255 branch July 22, 2021 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge Pull requests that are approved and ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot rename bundles

4 participants