Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix favicon loading so it does not block data storage #141

Merged
merged 1 commit into from
Apr 25, 2021

Conversation

vezwork
Copy link
Member

@vezwork vezwork commented Apr 9, 2021

Fixes #137 [BUG] Top Site Detail shows "undefined" after visiting a site for a very short period of time

Changes

  • Removes the await from the updateOriginFavicon function call in the updateAkitaData function definition in storage.js. This await was causing an issue because the updateOriginFavicon function awaits a fetch on the favicon image which may take an indefinite time to complete, blocking the function and in-turn indefinitely blocking data storage in the updateAkitaData function.
  • Adds text display handling for when visitCountor timeSpent are 0.

@vezwork vezwork requested a review from sharon-wang April 9, 2021 02:30
@vezwork vezwork added this to the Submit to Firefox/Chrome/Edge milestone Apr 9, 2021
src/popup/popup.js Outdated Show resolved Hide resolved
@vezwork vezwork force-pushed the fixUndefinedTimeSpentDetail branch from a02faa0 to 5276724 Compare April 25, 2021 18:42
@vezwork vezwork force-pushed the fixUndefinedTimeSpentDetail branch from 5276724 to 3edf9ab Compare April 25, 2021 18:42
@vezwork vezwork requested a review from sharon-wang April 25, 2021 18:43
Copy link
Member

@sharon-wang sharon-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@sharon-wang sharon-wang merged commit 26fea1a into esse-dev:master Apr 25, 2021
vezwork added a commit to vezwork/akita that referenced this pull request May 28, 2021
This bug was introduced in esse-dev#141.
This PR made it so that favicon fetching did not block storing
originData. This resulted in the originData object being updated after
it had already been stored, meaning the updated originData object was
never stored.

Fixing this issue requires introducing a new function
`storeOriginFavicon`which fetches the favicon, and once/if the fetch
resolves, updates and stores the originData safely using a lock.
sharon-wang added a commit that referenced this pull request May 30, 2021
* Fix originData favicon path not being stored

This bug was introduced in #141.
This PR made it so that favicon fetching did not block storing
originData. This resulted in the originData object being updated after
it had already been stored, meaning the updated originData object was
never stored.

Fixing this issue requires introducing a new function
`storeOriginFavicon`which fetches the favicon, and once/if the fetch
resolves, updates and stores the originData safely using a lock.

* Update src/data/storage.js

Co-authored-by: Sharon Wang <[email protected]>

* Update src/data/storage.js

Co-authored-by: Sharon Wang <[email protected]>

* Update src/data/storage.js

Co-authored-by: Sharon Wang <[email protected]>

* Update src/data/storage.js

Co-authored-by: Sharon Wang <[email protected]>

* Update src/data/storage.js

Co-authored-by: Sharon Wang <[email protected]>

* Update src/data/storage.js

Co-authored-by: Sharon Wang <[email protected]>

* Address PR comments

* Fix nits

Co-authored-by: Sharon Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Top Site Detail shows "undefined" after visiting a site for a very short period of time
2 participants