Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support from_time for the /tracking/<user_ids> endpoint #2277

Open
vicb opened this issue Nov 5, 2020 · 7 comments · May be fixed by #2312
Open

[Feature] Support from_time for the /tracking/<user_ids> endpoint #2277

vicb opened this issue Nov 5, 2020 · 7 comments · May be fixed by #2312

Comments

@vicb
Copy link
Contributor

vicb commented Nov 5, 2020

This feature request is similar to how /tracking/<user_id>/json supports a last_update parameter to only fetch the latest points... but a bit different.

The idea is to be able to request the updates for a group of pilots from a given time so last_update should be a timestamp (number of seconds since January 1, 1970 12:00:00 AM).

The way last_update is implemented in /tracking/<user_id>/json would not work.
That's because in this case last_update is the number of seconds since prior midnight UTC of the first track point.

Let's say pilotA starts flying at 23:30 UTC and pilotB starts flying at 00:30 UTC then their reference day would be different and there is no one last_update value that is common to both. Making last_update a timestamp for the /tracking/<user_ids> endpoint would solve this.

Context: I am revamping the SkyLines tracker support into flyxc.app.

Thanks !

@vicb
Copy link
Contributor Author

vicb commented Nov 24, 2020

Hey @Turbo87 do you think this is a good idea ?

Would you merge this if I create a PR ?

The query parameter could be called from_time and take a UNIX timestamp.
It could be added to the endpoints:

  • /tracking/latest.json
  • /live/<user_ids>
  • /live/<user_id>/json in complement of the already existing last_update.

The advantage would be that I don't have to pull 12h of track every time I retrieve positions from Skylines. It would save bandwidth and CPU.

What do you think ?

@Turbo87
Copy link
Member

Turbo87 commented Nov 30, 2020

seems like a reasonable request. I'm a little worried about breaking the existing code though, so it would be great if you could ensure that we have decent test coverage for these endpoints before modifying them. 🙏

@vicb
Copy link
Contributor Author

vicb commented Nov 30, 2020

Thanks @Turbo87 I'll give it a try.

I am having troubles installing the Vagrant env.

On the first vagrant up I get the error default: Failed to fetch http://ppa.launchpad.net/jonathonf/python-2.7/ubuntu/dists/trusty/main/binary-amd64/Packages 403 Forbidden [IP: 91.189.95.83 80]. A second vagrant up goes through but I suspect I have missing dependencies.

Do you have updated instructions on how to setup the development environment and run the tests ?

Thanks,
Vic

@Turbo87
Copy link
Member

Turbo87 commented Nov 30, 2020

I haven't run if for a while. It's possible that some dependency update broke it... 😞

welcome to the rabbit hole 🎉

@vicb
Copy link
Contributor Author

vicb commented Nov 30, 2020

I can try to investigate this.

How do you debug the server ?

What are the steps to install the python deps an run the tests ?

I guess
pipenv install --dev and then ?

@Turbo87
Copy link
Member

Turbo87 commented Nov 30, 2020

How do you debug the server ?

depends on what exactly you mean by that

What are the steps to install the python deps an run the tests ?

# Install Python dependencies
- run: pip install pipenv==v2020.4.1b2
- run: pipenv install --dev
# Run the test suite
- run: pipenv run py.test -vv --color=yes --cov=skylines --cov-report term-missing:skip-covered
should give a few hints.

@vicb
Copy link
Contributor Author

vicb commented Nov 30, 2020

I have hacked a working config using https://github.com/nektos/act

Using the comand:

$ act -P ubuntu-latest=nektos/act-environments-ubuntu:18.04 -j backend

I should be able to make some progress with that.

Thanks for your help.

@vicb vicb changed the title [Feature] Support last_update for the /tracking/<user_ids> endpoint [Feature] Support from_time for the /tracking/<user_ids> endpoint Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants