algolia / algoliasearch-client-android

Algolia Search API Client for Android
MIT License
99 stars 29 forks source link

Offline fallback timeout wrongly interpreted when using time unit #549

Closed clement-leprovost closed 6 years ago

clement-leprovost commented 6 years ago

Current behavior

On a MirroredIndex, when setting the offline fallback timeout using MirroredIndex.setOfflineFallbackTimeout(long, TimeUnit), the conversion between the specified time unit and milliseconds is erroneous, resulting in the wrong timeout being applied.

Expected behavior

The TimeUnit.convert method works the other way round.

Proposed solution

Just switch the direction of conversion! ;)

I quickly reviewed other call to TimeUnit.convert in the same file (here and here) and they seem correct, but probably a scan of the full codebase would be required to hunt down any other occurrences of this bug.

References

robertmogos commented 6 years ago

https://github.com/algolia/algoliasearch-client-android/pull/550

PLNech commented 6 years ago

Released in v3.22.14.