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

Display correct quota info in supported browsers. #109

Merged
merged 2 commits into from
Mar 23, 2021

Conversation

dero
Copy link
Collaborator

@dero dero commented Mar 18, 2021

Summary

Issue: The information displayed on Manage Downloads page is incorrect (hardcoded).

image

Solution: Use the StorageManager.estimate method to retrieve correct values for the quota and used space in browsers that support it.

Checklist

  • My pull request is addressing an open issue (please create one otherwise).
  • My code is tested and passes existing tests.
  • My code follows the Contributing Guidelines (updates are often made to the guidelines, check it out periodically).

@dero dero requested a review from derekherman March 18, 2021 14:10
@dero dero self-assigned this Mar 18, 2021
derekherman
derekherman previously approved these changes Mar 19, 2021
Copy link
Collaborator

@derekherman derekherman left a comment

Choose a reason for hiding this comment

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

Works as expected, but has exposed a bug. Which is that the delete all button doesn't actually delete the video from storage or at least not from the calculations.

@dero
Copy link
Collaborator Author

dero commented Mar 19, 2021

Thanks, @derekherman – I'm now (1343425) dispatching an event in our IDB connection anytime the data in the database change (new data is written or existing data get removed). The storage quota message subscribes to those event and redraws reactively.

Observing a download operation is a good example, see screencast.

2021-03-19_10-54-39.mp4

(It also shows how write operations sometimes need a second to actually finish writing the data to the database after the download is paused. That is expected due to the async IDB design.)

@dero dero requested a review from derekherman March 19, 2021 09:58
@derekherman
Copy link
Collaborator

@delawski really great addition to the PR. However, I was referring to how those numbers responds to a delete all event. Here's a video.

Screen.Recording.2021-03-19.at.5.37.42.PM.mov

@dero
Copy link
Collaborator Author

dero commented Mar 20, 2021

@derekherman Thanks for the screencast – delete all should work and report the change. It works in my testing.

2021-03-20_08-57-56.mp4

The issue you're seeing is likely due to you testing in Incognito. See related bug in Chromium bug tracker. I'd say private browsing is going to mess up the experience in strange ways in multiple browsers, for example Firefox doesn't allow IDB access at all in their Private mode.

@derekherman derekherman merged commit 1cda702 into develop Mar 23, 2021
@derekherman derekherman deleted the add/storage-quota-info branch March 23, 2021 07:32
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.

2 participants