iitc-project / ingress-intel-total-conversion

ingress.com/intel total conversion user script with some new features. Should allow easier extension of the intel map.
http://iitc.jonatkins.com/
ISC License
989 stars 552 forks source link

Sometimes old username shown on resonators #393

Closed reduc closed 11 years ago

reduc commented 11 years ago

I changed my Ingress username a while ago. The Ingress Intel page allways shows my new username on resonators placed by me, but IITC still sometimes shows my old username on resonators.

Sometimes my new username is shown on the resonators and after a few seconds it is replaced with my old username. How is this even possible? I thought IITC gets the same Information as the usual Intel and only does some calculations and visual enhancement.

vita10gy commented 11 years ago

Iitc caches the names. We might need to add a timeout.

reduc commented 11 years ago

I changed my username about 3 months ago. Deleting the browser (Firefox 21) cache does not fix the problem.

jonatkins commented 11 years ago

It's cached, but not in the browser cache, but rather the 'local storage' for the ingress.com site.

Firefox doesn't have an easy way to clear the storage for one site - https://support.mozilla.org/en-US/questions/764893

reduc commented 11 years ago

I deleted all entries in the ingress scope (and the Firefox Cache again). It seemed to work for about a minute, but then my old username appeared again. When I looked back into the Firefox database it was there again, too. Does IITC get the old username from the intel page?

This bug also appears while using private browsing.

jonatkins commented 11 years ago

OK, looks like the code will use player names in chat to help lookup the names. So if you scroll back in chat to a point where the old name was in use, this ends up overwriting the correct value.

This use of names from chat is both good and bad. For new chat messages, it's likely to be correct - and will override older out-of-date cache entries. For old chat messages though, it could be wrong, overwriting a player name with an older version.

I'll see what I can do here...

reduc commented 11 years ago

True, I am mentioned in the chat with my old and my new username if I use small areas of the map.

Can you get the timestamp of the chat message? Maybe you could store that and then only overwrite the cache data if the timestamp is bigger than the old one.