Skip to content

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

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

Merged
merged 3 commits into from
Jul 18, 2021

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

Sorry, something went wrong.

@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 needs - code 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