parse-community / Parse-SDK-dotNET

Parse SDK for .NET, Xamarin, Unity.
http://parseplatform.org
Apache License 2.0
323 stars 260 forks source link

Fix StorageController.LoadAsync() #319

Closed Riteo closed 5 years ago

Riteo commented 5 years ago

Fix StorageController.Storage null check on StorageController.LoadAsync(). Before this commit it null checked a Task with a result of StorageController.Storage, which always returns a non null object, instead of checking StorageController.Storage itself.

Fix cache reading from UTF-8 to UTF-16 as FileInfo.OpenText creates a FileStream encoded in UTF-8.

Stop StorageController from loading its storage on instantiation as it isn't awaitable, rendering it useless on first access and requiring to call it externally, essentially calling it twice.

codecov[bot] commented 5 years ago

Codecov Report

Merging #319 into master will decrease coverage by 2.3%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #319      +/-   ##
==========================================
- Coverage   58.77%   56.47%   -2.31%     
==========================================
  Files          91       91              
  Lines        6128     6128              
  Branches        0     1011    +1011     
==========================================
- Hits         3602     3461     -141     
+ Misses       2526     2488      -38     
- Partials        0      179     +179
Impacted Files Coverage Δ
Parse/Internal/Utilities/StorageManager.cs 75% <100%> (+6.03%) :arrow_up:
...e/Internal/Storage/Controller/StorageController.cs 50% <100%> (+24.41%) :arrow_up:
Parse/Internal/Push/State/MutablePushState.cs 42.5% <0%> (-45%) :arrow_down:
Parse/Internal/Push/Coder/ParsePushEncoder.cs 61.11% <0%> (-13.89%) :arrow_down:
Parse/Public/ParseClient.cs 63.41% <0%> (-10.66%) :arrow_down:
Parse/Internal/Command/ParseCommand.cs 85.1% <0%> (-10.64%) :arrow_down:
Parse/Internal/Operation/ParseRemoveOperation.cs 36.84% <0%> (-10.53%) :arrow_down:
Parse/Public/ParseQuery.cs 14.35% <0%> (-8.72%) :arrow_down:
Parse/Public/ParseACL.cs 77.38% <0%> (-8.34%) :arrow_down:
Parse/Internal/Operation/ParseFieldOperations.cs 75% <0%> (-8.34%) :arrow_down:
... and 29 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 077b48e...121fde8. Read the comment docs.

Riteo commented 5 years ago

Oh wait, TobiasPott already fixed this better in one of his forks . Now i don't know what to do, should i close this?

Riteo commented 5 years ago

well, i think i'll close it then.

TobiasPott commented 5 years ago

Hi @Riteo I'm sorry that nothing happened on this issue for the last days.

Unfortunately I'm quite busy at work at the time but I have some maintaining tasks for this repo on my todo for the next week which includes performing the pull request of my changes to the StorageController.LoadAsync method.

However thank you for your PR which brought my changes back to my mind and bumping their priority on my personal todo list ;)