find icon indicating copy to clipboard operation
find copied to clipboard

Get user location api call does not work properly

Open DorianTe opened this issue 8 years ago • 1 comments

Whenever i execute this command:

curl -X GET http://localhost:8003/location?group=TESTGROUP&user=dorian

It returns the following information:

{"message":"Correctly found locations.","success":true,"users":{"dorian":[{"time":"2017-09-20 11:47:22.501935543 +0000 UTC","location":"office","bayes":{"kantine":-0.7071067811865475,"office":0.7071067811865476},"svm":{"kantine":-2.2507614392718738,"office":-0.11128804882262555},"rf":null}], "ian":[{"time":"2017-09-20 10:42:48.528923721 +0000 UTC","location":"office","bayes":{"kantine":-0.7071067811865475,"office":0.7071067811865476},"svm":{"kantine":-3.235615148872499,"office":-0.04013056694473616},"rf":null}]}}

As you can see it returns all users (there are only 2 users) in the group instead of only user "dorian".

iam not a go-lang pro but i took a dive into the code and think the culprit is the foreach loop in getUserLocations function in api.go. (but then again iam very inexperienced with go-lang so i could be wrong.)

DorianTe avatar Sep 20 '17 15:09 DorianTe

That's very strange. Would you be able to send me your database? Email to [email protected]

schollz avatar Sep 22 '17 15:09 schollz