andreicristianpetcu / incompat

A WebExtension that pulls data from https://webcompat.com and shows issues on the sites you visit
https://addons.mozilla.org/en-US/firefox/addon/incompat/
GNU General Public License v3.0
4 stars 0 forks source link

Incompat add-on fails when several tabs are opened #9

Open softvision-sergiulogigan opened 4 years ago

softvision-sergiulogigan commented 4 years ago

Browser / Version Firefox Nightly 72.0a1 (2019-11-20)

Operating System Windows 10

Prerequisites:

Steps to reproduce:

  1. Navigate to: https://github.com/webcompat/web-bugs/milestone/2
  2. Open several issues in their own tabs (eg. 10).

Expected Behavior: All opened taps show the correct information in the Incompat pop-up.

Actual Behavior: Only the first few issues show the correct information in the Incompat pop-up (eg. 5). The rest, show "undefined" information.

Notes:

  1. Screenshot attached.

Watchers: @softvision-oana-arbuzov @softvision-sergiulogigan @cipriansv

image

andreicristianpetcu commented 4 years ago

I think I saw this once. Had no clue how to reproduce. Will look into your scenario.

andreicristianpetcu commented 4 years ago

damn it. It's the GitHub rate limiting again :cry:

andreicristianpetcu commented 4 years ago

@softvision-sergiulogigan I published a new version for both Firefox and Chrome v1.2.2. The old one cached GitHub responses so it will not fetch the info every time you reload the page. Unfortunately some times I get banned by GitHub for too many requests in a small time interval. This led my cache to contain invalid data. The only way to invalidate the cache and fetch the data again was to restart the browser. The idea was that this cache would not last forever and invalidating on browser restart was the most trivial implementation.

This new version only caches valid data from GitHub. Basically if you open too many tabs and some of them will have invalid data, you just need to refresh that page. The cache is still there and gets invalidated on restart but I don't populate it with invalid data. This is a quick fix for this issue. I need to investigate how I can use GitHub APIs in my extension securely.