Skip to content

[Bug]: Race condition possibility with setLocaleIdentifier #198

Open
@lukehutch

Description

@lukehutch

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS

Steps to reproduce

In a recent version of flutter-geocoding, instead of passing the locale identifier as part of the request (e.g. placemarkFromCoordinates(lat, long, localeIdentifier), now the user has to first call setLocaleIdentifier(localeIdentifier), and then call placemarkFromCoordinates(lat, long).

This is problematic if (like in my app) the locale identifier is switching frequently, and there may be more than one reverse geocoding call at a given time (basically I need to be able to reverse geocode into several locales at the same time). There is a race condition, whereby two different threads could interfere with each other's geocoding call.

I know this is an unusual usecase, but the chance for race condition is real, and this is not a good API change.

Expected results

Locale should always be passed in the call (as it is in the currently-released version).

Actual results

Locale is passed in a separate initial step, in the git latest version.

Code sample

N/A

Screenshots or video

N/A

Version

N/A

Flutter Doctor output

N/A

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work list.platform: androidIssue is related to the Android platform.refactorIssues marked with refactor should be considered when refactoring the plugin.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions