fixes #46
We only recrawl and consequently update the trust status, if the site containing the human.json is a trusted site.
(LLM only used to explain some browser extension things to me; all text and reasoning done by myself)
Why should you merge this?
handleHumanJsonLink is called on each page load. We only want to propagate the vouched_by and hops properties, if the site is trusted, which is (1) the current page is a seed or (2) the page is already vouched for.
Why shouldn't you merge this?
The recursive function calls and lack of available sites, makes it hard for me to keep all relevant code paths in memory. Therefore, the introduced check might skip updates to aggressively.
I think it might be worth adding tests for part of the update logic. (As I already spend quite some hours on the analysis, thats a topic for another day)
Full chain of argument
human.json site data is stored in IndexedDB humanJsonTrust keyed by site URL.
- A trusted site is stored with
isSeed = 1
- achieved through
background.js → addSeed → store.addSeed → crawler.rawlFrom
removeSeed calls recrawlAll, which in turn recalculates the graph
resetNonSeedHops within recrawlAll works (confirmed by looking into IndexedDB while debugging)
crawlFrom is called through handleHumanJsonLink on each page load, which has a human.json , iff that site vouches for sites, this vouch information is added to the target sites in the humanJsonTrust database although the loaded site is not a seed.
fixes #46
We only recrawl and consequently update the trust status, if the site containing the human.json is a trusted site.
(LLM only used to explain some browser extension things to me; all text and reasoning done by myself)
## Why should you merge this?
`handleHumanJsonLink` is called on each page load. We only want to propagate the `vouched_by` and `hops` properties, if the site is trusted, which is (1) the current page is a seed or (2) the page is already vouched for.
## Why shouldn't you merge this?
The recursive function calls and lack of available sites, makes it hard for me to keep all relevant code paths in memory. Therefore, the introduced check might skip updates to aggressively.
I think it might be worth adding tests for part of the update logic. (As I already spend quite some hours on the analysis, thats a topic for another day)
## Full chain of argument
- `human.json` site data is stored in IndexedDB `humanJsonTrust` keyed by site URL.
- A trusted site is stored with `isSeed = 1`
- achieved through `background.js` → `addSeed` → `store.addSeed` → `crawler.rawlFrom`
- `removeSeed` calls `recrawlAll`, which in turn recalculates the graph
- `resetNonSeedHops` within `recrawlAll` works (confirmed by looking into IndexedDB while debugging)
- `crawlFrom` is called through `handleHumanJsonLink` on each page load, which has a `human.json` , **iff** that site vouches for sites, this vouch information is added to the target sites in the `humanJsonTrust` database although the loaded site is **not** a seed.