These are chat archives for Ruhrpottpatriot/GW2.NET

15th
Jan 2016
Steven Liekens
@StevenLiekens
Jan 15 2016 12:11
@Ruhrpottpatriot core.autocrlf "true" converts all line endings to LF when committing
then converts them back to CRLF when checking out
is that what we want?
Robert Logiewa
@Ruhrpottpatriot
Jan 15 2016 16:55
yes
that is what we want
it converts all to LF and checks out CRLF on windows
on OSX and Linux it keeps them at LF
Need yout input on something:
With the new repositories I first do a check if the items are in the cache (which does a check if they are stale), if they are i return the cached items.
However: What to do about the method that returns all items?
Possible Solutions:
  • Change the cache to include a property that stores all possible IDs indipendent from the objects stored). Then when doing the check, I do a complement operation on the IDs and request only the missing ids
  • Always do a full a request against the API bypassing the cache
Robert Logiewa
@Ruhrpottpatriot
Jan 15 2016 17:04
Thoughts?
Steven Liekens
@StevenLiekens
Jan 15 2016 18:47
hmm
third option
Robert Logiewa
@Ruhrpottpatriot
Jan 15 2016 18:48
I'm listening
Steven Liekens
@StevenLiekens
Jan 15 2016 18:48
actually nvm
first option is the way to go
Robert Logiewa
@Ruhrpottpatriot
Jan 15 2016 18:49
the first would mean, that we are doing a discover if the cache is empty.
and set the stale timer for it separately
Steven Liekens
@StevenLiekens
Jan 15 2016 18:50
so basically
get all IDs at most every 5 minutes (or whatever the expires header value is)
and only fetch items that are not already in the cache or stale
right?
Robert Logiewa
@Ruhrpottpatriot
Jan 15 2016 18:53
yeah, basically. Check if the ids are stale. If they are fetch a new set. Then do an intersect with the ids of stored objects in the cache not yet stale. Then query all missing ids
Steven Liekens
@StevenLiekens
Jan 15 2016 18:54
missing ids + ...stale items?
or only missing ids?
Robert Logiewa
@Ruhrpottpatriot
Jan 15 2016 18:55
yeah. Since if the item is stale it's not getting returned in the second set so it cannot be removed via the intersect
Steven Liekens
@StevenLiekens
Jan 15 2016 18:56
you don't have to do the intersect since your code won't hit the network for items already in the cache
so it will just give you a bunch of references to objects already in the cache
Robert Logiewa
@Ruhrpottpatriot
Jan 15 2016 18:59
sec

Let I be a set if Ids from discover, let S be a set of ids of objects in the cache.
Then we do the following:

if I == stale { update I }
S := cache.Ids.Where(i => i.NotStale)
Q := I \ S
call api with Q

We have to hit the cache to check if n > 0 items are stale. These items have to be requieried, since we can't guarantee them to be accurate, too

Steven Liekens
@StevenLiekens
Jan 15 2016 19:13
accurate?
Robert Logiewa
@Ruhrpottpatriot
Jan 15 2016 19:13
not outdated
Steven Liekens
@StevenLiekens
Jan 15 2016 19:15
that could be a problem for commerce APIs
Robert Logiewa
@Ruhrpottpatriot
Jan 15 2016 19:15
A repository does not automatically have a cache
Also: We always can set the expires header to the same timestamp as the query date
with that the items are always considered stale, effectively bypassing a cache
Steven Liekens
@StevenLiekens
Jan 15 2016 19:21
first things first
the game client uses new header bytes for chat links
that needs to be fixed
Robert Logiewa
@Ruhrpottpatriot
Jan 15 2016 19:22
yeah
Steven Liekens
@StevenLiekens
Jan 15 2016 19:22
uhm
there are some commits in my fork that haven't made it back to you
it's a bit of a mess
Robert Logiewa
@Ruhrpottpatriot
Jan 15 2016 19:46
do I need to pull some commits?
Steven Liekens
@StevenLiekens
Jan 15 2016 20:00
I'm thinking
this commit was a mistake Ruhrpottpatriot/GW2.NET@a0782a5
because that change was supposed to be done on the maintenance branch and then merged
Robert Logiewa
@Ruhrpottpatriot
Jan 15 2016 20:02
ugh
do a revert commit
Steven Liekens
@StevenLiekens
Jan 15 2016 20:03
I was thinking about dropping it entirely
Robert Logiewa
@Ruhrpottpatriot
Jan 15 2016 20:03
why?
Steven Liekens
@StevenLiekens
Jan 15 2016 20:03
because it's still the tip of the branch
so you can drop it without rewriting commit IDs
Robert Logiewa
@Ruhrpottpatriot
Jan 15 2016 20:04
than do that
I havn't pulled yet
Steven Liekens
@StevenLiekens
Jan 15 2016 21:00
@Ruhrpottpatriot what is the last commit ID that you pulled?
Steven Liekens
@StevenLiekens
Jan 15 2016 21:09
I want to reset to a state where everything was still good
Steven Liekens
@StevenLiekens
Jan 15 2016 22:13
wtf git :(
I thought it was just line endings that were my problem
apparently git also wants to control which files have a BOM and which don't
stripping the BOM from some files but not others
with no rhyme or reason