parse-community / ParseLiveQuery-Android

Parse LiveQuery client for Android.
Other
84 stars 32 forks source link

Back the subscriptions by a thread safe collection map #80

Closed mmimeault closed 6 years ago

mmimeault commented 6 years ago

Fixing: https://github.com/parse-community/ParseLiveQuery-Android/issues/78

We started to having this issue when using the client in a multi-thread context. The SparseArray initially used was a good idea to optimize a mapping between an Integer and an Object. But obviously, it is not "thread safe". Instead of doing a full synchronized wrapper over the SparseArray, let's simply use a Concurrent Hash map.

codecov[bot] commented 6 years ago

Codecov Report

Merging #80 into master will increase coverage by 0.08%. The diff coverage is 83.33%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master     #80      +/-   ##
===========================================
+ Coverage     68.11%   68.2%   +0.08%     
  Complexity       82      82              
===========================================
  Files            11      11              
  Lines           367     368       +1     
  Branches         24      24              
===========================================
+ Hits            250     251       +1     
  Misses          103     103              
  Partials         14      14
Impacted Files Coverage Δ Complexity Δ
.../main/java/com/parse/ParseLiveQueryClientImpl.java 75.7% <83.33%> (+0.11%) 56 <1> (ø) :arrow_down:

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 d483d1b...b5f3ccc. Read the comment docs.