eugenio412 / PogomBOT

A Telegram bot for pogom
31 stars 17 forks source link

/load gives wrong data #60

Closed urinella closed 8 years ago

urinella commented 8 years ago

Checklist

For example. A few guys using one bot in their own chats. All of them doing /save. Restarting the Bot. When the guys doing /load not all of them have the saved pokemonlist. Some of them have nothing, some have a wrong list. A few guys have the location and radius of guy no. 1 in their bot.

Edit: Files from /save with chatids are on the server with correct data

Unknown66 commented 8 years ago

Mhh that's interesting could you please provide the log for that time?

urinella commented 8 years ago

How do I do that? Is there a logfile or something? :)

Unknown66 commented 8 years ago

No we decided to not write a logfile. (Because it's getting large fast, toggle should be added as parameter. Its on todo) By now you're only able to fetch the log from console.

urinella commented 8 years ago

Okay I did this again with the location error:

2016-09-20 16:53:26,950 - main:223 - INFO - [15261887] Load. 2016-09-20 16:53:26,952 - main:489 - INFO - [15261887] loadUserConfig. 2016-09-20 16:53:26,953 - main:536 - INFO - [15261887] getUserConfigPath. 2016-09-20 16:53:27,278 - main:328 - INFO - [15261887] Adding job. 2016-09-20 16:53:27,391 - main:190 - INFO - [15261887] List. 2016-09-20 16:53:28,833 - main:223 - INFO - [36145634] Load. 2016-09-20 16:53:28,834 - main:489 - INFO - [36145634] loadUserConfig. 2016-09-20 16:53:28,836 - main:536 - INFO - [36145634] getUserConfigPath. 2016-09-20 16:53:28,939 - main:328 - INFO - [36145634] Adding job. 2016-09-20 16:53:29,032 - main:190 - INFO - [36145634] List. 2016-09-20 16:53:37,035 - main:295 - INFO - [15261887] Retrieved Location as Lat 54.315412, Lon 10.117618, R 1.0 2016-09-20 16:53:37,057 - main:305 - INFO - [15261887] Set Location as Lat 54.315412, Lon 10.117618, R 1.0 2016-09-20 16:53:42,701 - main:295 - INFO - [36145634] Retrieved Location as Lat 54.322658, Lon 10.12363, R 1.0 2016-09-20 16:53:42,704 - main:305 - INFO - [36145634] Set Location as Lat 54.322658, Lon 10.12363, R 1.0 2016-09-20 16:53:57,289 - main:323 - INFO - [15261887] Checking alarm. 2016-09-20 16:53:57,306 - main:357 - INFO - [15261887] Checking pokemon and sending notifications.

Okay, Bot is running on machine from: 15261887

36145634 and 15261887 doing /load

and then: /radius 1000 so see if location is correct.

Log says the location is correct.

But telegram says in Both chats:

Setting scan location to: 54.315412 / 10.117618 with radius 1000.00 m

Unknown66 commented 8 years ago

I'll check this if I've got time today's evening.

wardsimon commented 8 years ago

I'm doing the preference stuff now and will look at. There is a small problem not connected to this in the radius function which I've found and fixed and I've re-written a bit. Just going to test if this is still there....

Unknown66 commented 8 years ago

@simonward86 one little question why didn't you use https://pypi.python.org/pypi/geopy ? I think we should switch to geopy because we're able to notify the user of the location of the pokemon then.

wardsimon commented 8 years ago

I thought that you needed another API key to perform a search. The implementation of the GeoLocation method just uses simple maths.

On both my new version and the version from the development branch I have been unable to re-create this. (did find a tiny unrelated error though)

urinella commented 8 years ago

@simonward86 Have you tested on different computer in different networks?

In one bot I have 10 users from 10 different networks and about 5 of them got the wrong pokemonlist after /load And for the location its enough to have 2 users.

Btw. I'm using Windows10, MySQL and the latest version of the development branch

wardsimon commented 8 years ago

@urinella I was going to ask about this.

I've tried with 2 users, Linux, MySQL and development branch. I'll try different networks but this should not be a problem. It sounds like a problem with the loading, which means the user id's are getting confused.... A deeper look is needed then.

Unknown66 commented 8 years ago

@simonward86 The geopy package don't need any further api key. I think we could use it to show the address of the pokemon (requested by A A from telegram)

wardsimon commented 8 years ago

@Unknown66 I've moved to the geopy package for distance calculation as it is easier and added a reverse lookup call for text sent locations. (a187598951c5e54816ccd4db09d389f2dca55415) . You were correct, openstreetmaps does not need an API key. I've just used geopy with google maps, which does require a key. I think testing on the new preference structure is needed to see if this bug is still around.

Unknown66 commented 8 years ago

@urinella is the bug fixed in current develop release?

Unknown66 commented 8 years ago

Seems to be fixed no comment right now.