Skip to content

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.

@yaira2 yaira2 requested a review from winston-de July 18, 2021 04:11
@yaira2 yaira2 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
@yaira2
Copy link
Member

yaira2 commented Jul 18, 2021

@gave92 thank you!

@yaira2 yaira2 merged commit 746a9b2 into files-community:main Jul 18, 2021
@yaira2 yaira2 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