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

Make location lookup look at existing users' coordinates as a last resort #555

Merged
merged 5 commits into from Dec 8, 2020

Conversation

michielderoos
Copy link
Contributor

Describe the Pull Request

Make location lookup look at existing users' coordinates as a last resort. Also apply retroactively!

Todo

  • Link relevant trello card or related issue to the pull request
  • Request review from relevant @person or team
  • QA your pull request. This includes running the app, login, testing changes etc.
  • Bump backend and/or frontend versions following Semver

@michielderoos
Copy link
Contributor Author

@codecov
Copy link

codecov bot commented Nov 20, 2020

Codecov Report

Merging #555 (18fd12b) into master (8d882aa) will increase coverage by 30.23%.
The diff coverage is 78.57%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #555       +/-   ##
===========================================
+ Coverage   16.98%   47.22%   +30.23%     
===========================================
  Files         199      337      +138     
  Lines        7787    17600     +9813     
  Branches     1348     1347        -1     
===========================================
+ Hits         1323     8312     +6989     
- Misses       6431     9255     +2824     
  Partials       33       33               
Flag Coverage Δ
javascript 4.76% <ø> (ø)
python 70.39% <78.57%> (+5.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
app/migrations/seed.py 63.41% <33.33%> (ø)
app/server/utils/location.py 90.74% <100.00%> (ø)
app/server/utils/user.py 70.86% <100.00%> (ø)
config.py 82.96% <100.00%> (+0.74%) ⬆️
app/server/api/synchronization_filter_api.py 100.00% <0.00%> (ø)
app/server/api/poli_payments_api.py 30.76% <0.00%> (ø)
app/server/api/search_api.py 73.40% <0.00%> (ø)
app/server/utils/multi_chain.py 100.00% <0.00%> (ø)
app/server/utils/transfer_limits/checks.py 93.61% <0.00%> (ø)
app/server/utils/ussd/kenya_ussd_state_machine.py 96.77% <0.00%> (ø)
... and 133 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d882aa...18fd12b. Read the comment docs.

Copy link
Contributor

@tristanhcole tristanhcole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me! 👍

Comment on lines +424 to +425
refresh_user_locations(current_app)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to be running this on every app launch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so. It's not a task well suited to migrations, and we have a task queued to remove it once this PR makes it into prod

Comment on lines +27 to +28
Checks if another user has a manually set coords for a given location name.
If they do, steal them!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵️

@tristanhcole
Copy link
Contributor

tristanhcole commented Dec 8, 2020

HAHAHA. I tested this with "banana" as the location set to Melbourne but apparently, there is a town called banana in Australia. https://www.google.com/maps/place/Banana+QLD+4702/data=!4m2!3m1!1s0x6bc13d589f58a60f:0x400eef17f20ccc0?sa=X&ved=2ahUKEwiAlNXZs73tAhXH4zgGHQKRC4gQ8gEwG3oECCcQAQ

🍌

@michielderoos michielderoos merged commit 12c3aa3 into master Dec 8, 2020
@michielderoos michielderoos deleted the fix-location-cache branch December 8, 2020 16:10
enjeyw added a commit that referenced this pull request Dec 15, 2020
* master: (28 commits)
  Adding blockchain_task_uuid index to worker messages (#551)
  Make location lookup look at existing users' coordinates as a last resort (#555)
  Add support for Commcare (#569)
  Improve external transaction detection (#570)
  Remove unused imports (#571)
  Celo integration (#535)
  feat: small improvements to accessibility across the web app (#562)
  Group by Sender and Recipient (#567)
  Enable multiple chains (#496)
  Silence loading spinner warning (#568)
  Custom attribute bugfix (#549)
  Antify Message Bar (#566)
  Stop retrying infinitely (#565)
  Only update BlockchainTransaction on the worker when we absolutely have to (#564)
  Make SynchronizedBlock be updated in batch instead of one giant update (#563)
  Hide Filters and Groups (#558)
  adding more colors to charts, and tweaking legends (#561)
  Chart Tweaks (#560)
  Recipients filter (#533)
  Dynamic transfer card loaded (#559)
  ...

# Conflicts:
#	app/server/api/transfer_card_api.py
#	app/test_app/functional/api/test_transfer_card_api.py
enjeyw added a commit that referenced this pull request Jan 15, 2021
* master: (27 commits)
  Minimum withdrawal amount (#528)
  Remove refresh_user_locations from seed.py (#576)
  Search 2.0 (#581)
  Re-implements the XLSX/CSV uploader (#575)
  Fix to make sure custom attributes are included on export (#592)
  Bump cairosvg from 2.4.2 to 2.5.1 in /app (#590)
  Remove orjson requirement (#591)
  URL Builder for Kobo/Commcare Integrations (#578)
  Re-Enable Caching for Metrics (#532)
  Do the thing (#589)
  fix: mock data error (#582)
  style: improve view only functionality (#587)
  Fix null subtraction error (#586)
  Don't make index if it's already there (#584)
  Circle was being weird. This fixes it! (#588)
  Transfer Card Fetching Improvements (#580)
  Make map work again (#577)
  Stop requiring chains and default_chain in config files (#579)
  Adding blockchain_task_uuid index to worker messages (#551)
  Make location lookup look at existing users' coordinates as a last resort (#555)
  ...

# Conflicts:
#	.circleci/config.yml
#	config.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants