From cb899d92a083f457221476cbb35f97b599e4089d Mon Sep 17 00:00:00 2001 From: Michael Peters Date: Wed, 19 Oct 2022 22:34:37 -0700 Subject: [PATCH] fix up comments in autoverifier test --- src/client/tests/webapp/auto-verifier.test.ts | 10 ---------- src/client/webapp/auto-verifier.ts | 6 ++++++ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/client/tests/webapp/auto-verifier.test.ts b/src/client/tests/webapp/auto-verifier.test.ts index 9cca739..c4aec9e 100644 --- a/src/client/tests/webapp/auto-verifier.test.ts +++ b/src/client/tests/webapp/auto-verifier.test.ts @@ -1515,16 +1515,6 @@ describe('fetchAndVerifyIfNeeded tests', () => { expect(verifyFunc).toHaveBeenCalledTimes(1); }); - // TODO: Why not have fetcher and a simple dedup wrapper to remove some complexity from this function? - // This would likely make it possible to get rid of the "else" block in tryResolveTrustedPromise - // Make sure it would work properly for retry functionality - // can't because of primary promise early resolution - - // Make sure to do try/catch errors/rejections, verification failures, unverifies in the middle - // Fetching after verified doesn't re-fetch trusted - // Unverify during verify w/ dedups - // verifyFunc rejects - // not possible (and therefore not tested) list // verifyFunc returns false while awaiting a trusted promise // - implies it's possible to enter the status === 'fetching' block diff --git a/src/client/webapp/auto-verifier.ts b/src/client/webapp/auto-verifier.ts index abea834..2bd33a2 100644 --- a/src/client/webapp/auto-verifier.ts +++ b/src/client/webapp/auto-verifier.ts @@ -176,6 +176,12 @@ export class AutoVerifier { this.trustedStatus = 'none'; } + // To consider: It may be possible to reduce the complexity of this function a bit. + // TODO: Why not have fetcher and a simple dedup wrapper to remove some of the complexity from this function? + // This would likely make it possible to get rid of the "else" block in tryResolveTrustedPromise + // Make sure it would work properly for retry functionality + // can't because of primary promise early resolution + // fetches the result of the primary fetchable // if the primary fetchable returns null but has not been verified yet, this will return the result of the trusted fetchable // if the trusted fetchable has not been used to verify the primary fetchable yet, this queries the trusted fetchable and calls verify