tracking-exposed / krgotrex

analysis of website, report if google third parties are present. campaign for cleaner web
https://kreuzberg.google.tracking.exposed
4 stars 1 forks source link

fixing a race condition #9

Closed vecna closed 5 years ago

vecna commented 5 years ago

the results of APIs: https://kreuzberg.google.tracking.exposed/api/v1/sites/krgotrex and https://kreuzberg.google.tracking.exposed/api/v1/results/krgotrex might differ. This is because sites return the website the invi.sible.link want to analyzed, but results return the website effectively analyzed.

This small discrepancy causes this error:

TypeError: /home/oo/Dev/invi.sible.link/campaigns/krgotrex/page/views/sites.pug:20
    18|               - const result = results.find(r => r.id === site.lastResultId) 
    19|               ul.site-googles
  > 20|                 each val, index in result.googles
    21|                   li.row.align-middle.alert
    22|                     small-8.large-10.column= index
    23|                     .small-4.large-2.column= val

Cannot read property 'googles' of undefined
vecna commented 5 years ago

The small patch fix the issue