tatey / trace_privately

A robust and fully featured key server for the TracePrivately iOS app
https://trace-privately-demo.herokuapp.com
MIT License
1 stars 0 forks source link

`since` parameter not working correctly? #24

Open HendX opened 4 years ago

HendX commented 4 years ago

I've just been experimenting with this app and I noticed the since parameter being ignored:

https://example.com/api/infected?since=2020-05-03T02:21:44Z

Steps:

  1. I created keys using the new SubmitFakeKeys command-line script I built
  2. In the web app, I approved the first submission
  3. In the iOS app, I relaunched. It received those keys
  4. In the iOS app, go to background then foreground (triggering a key update)
  5. Those initial keys were received again.

The way the iOS app works is that it saves the date received in the response and uses that for the next request.

I noticed on each subsequent request I'm receiving back the same date.

I suspect the issue is in infected_keys_controller.rb in the @updated_at parameter. I think instead of:

@updated_at = submissions.first&.updated_at || Time.current

It should be:

@updated_at = Time.current