These are chat archives for arenanet/api-cdi

4th
Dec 2018
darthmaim
@darthmaim
Dec 04 2018 19:09
@apoch so, #640...
I understand the point you made about just returning the data thats really in the database and not modifying it. So lets think about alternatives.
Maybe some technichal stuff first... Do you have last login/logout timestamps? When is the dungeon completion data actually written, I'm guessing only on login and when completing a dungeon? So if the player is already online before reset, a login/logout timestamp wouldn't help to get the actual completion data.
Is there a timestamp you could expose when the completion data was updated the last time?
Daniel Snider
@dsnider-anet
Dec 04 2018 19:23
I'm in favor of implementing a timestamp. I think it's personally fair to say: "This data you're accessing is accurate as of this timestamp: __".
It's also easier than trying to "fake" the daily expiration
darthmaim
@darthmaim
Dec 04 2018 19:23
Is there actually a timestamp in the data you could expose?
we would need last_dungeon_completion + last_login (if those are the times the completion data is written)
if both of those are before the last reset, we now it should be empty
I guess just last_dungeon_completion is actually enough
Daniel Snider
@dsnider-anet
Dec 04 2018 19:25
There is an actual timestamp in the data and I think it would be fairly trivial to expose. I'm worried about reasons not to
darthmaim
@darthmaim
Dec 04 2018 19:26
You could change it to a boolean has_completed_a_dungeon_since_reset if you don't want to expose the timestamp
Daniel Snider
@dsnider-anet
Dec 04 2018 19:27
So this is how I understand it works, and I may be wrong: If I complete a dungeon and acquire the reward at 23:55 UTC, and then I complete a dungeon at 00:5 UTC, then I will recieve the reward
If I'm correct, then last_dungeon_completion would not be required if last_login is available
darthmaim
@darthmaim
Dec 04 2018 19:28
Yeah, but if the player doesn't complete on at 00:05
lets say last_login is 23:00, player completes dungeon at 23:30, API reads data at 00:05, the API would return the dungeon as completed
which is wrong, because it was before reset
Daniel Snider
@dsnider-anet
Dec 04 2018 19:30
I don't think so (ignoring the cache)
instead of last_login, more like last_modified
darthmaim
@darthmaim
Dec 04 2018 19:31
is last_modified global (per character/account)?
-> is dungeon completion written every time some other data is written that could modify last_modified?
Daniel Snider
@dsnider-anet
Dec 04 2018 19:32
there is (effectively) one last_modified on each account and one last_modified on each character

is dungeon completion written every time some other data is written that could modify last_modified?

I'm 99% sure that's the case

darthmaim
@darthmaim
Dec 04 2018 19:33
ah good to know
Then a last_modified would be a nice solution for this usecase, and also help with some others
Daniel Snider
@dsnider-anet
Dec 04 2018 19:34
I agree. I have to think about any possible problems with exposing the info
darthmaim
@darthmaim
Dec 04 2018 19:34
The next question is, is there actually any harm in exposing it
Daniel Snider
@dsnider-anet
Dec 04 2018 19:34
^
Personally, I can't believe we wouldn't expose: "this data is fresh as of x", it seems like a crucial bit of info
darthmaim
@darthmaim
Dec 04 2018 19:36
And can really reduce requests for crawlers like gw2efficiency when they know no data changed since the last crawl
Daniel Snider
@dsnider-anet
Dec 04 2018 19:36
The guild panel has "Last Online", which I suspect is using the effective last_modified timestamp
darthmaim
@darthmaim
Dec 04 2018 19:38
Well, you could introduce a new scope for api keys timestamps and only expose it to keys with this permission set
so all users explicitly allow apps to read this data
but that would require thousands of people to generate new api keys
Daniel Snider
@dsnider-anet
Dec 04 2018 19:38
^
darthmaim
@darthmaim
Dec 04 2018 19:38
just to get some existing endpoints working correctly after reset
Daniel Snider
@dsnider-anet
Dec 04 2018 19:40
I'm having some trouble believing that last_modified isn't just completely fundamental to the idea of returning the data. And it's not like gw2e can't just monitor age seconds if it wanted to stalk players' play habits already
darthmaim
@darthmaim
Dec 04 2018 19:41
yeah
Mike Lewis
@apoch
Dec 04 2018 21:43
@dsnider-anet has already covered it :-) We have a timestamp for last time any change was saved to a character or account. This is trivial to expose via the API. The reasons for not doing it are entirely non-technical and frankly may no longer be compelling; historically we have had reservations about putting this data out there but I think it is entirely fair to revisit those concerns. My point in #640 was not that we shouldn't change this - more that we should make sure of what we're doing first.
darthmaim
@darthmaim
Dec 04 2018 21:45
:+1:
Mike Lewis
@apoch
Dec 04 2018 21:45
@darthmaim thanks for reviving this conversation. I'm pushing to close GitHub issues that we aren't able to make headway on, but I don't mean for that to imply we can't keep looking for solutions. Sorry for the scare :-)
darthmaim
@darthmaim
Dec 04 2018 21:45
no problem, I just personally don't like closing issues that are, well, still issues
Mike Lewis
@apoch
Dec 04 2018 21:46
Fair. I know my philosophy is not universal
Archomeda
@Archomeda
Dec 04 2018 21:46
Both have their ups and downs
Good thing issues can be reopened if necessary :)
darthmaim
@darthmaim
Dec 04 2018 21:48
well closing the issue actually triggered this discussion and finding a way to fix it :P