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

Add a wrapper around Chrome Storage API #9

Closed
maxpatiiuk opened this issue Sep 9, 2022 · 6 comments
Closed

Add a wrapper around Chrome Storage API #9

maxpatiiuk opened this issue Sep 9, 2022 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@maxpatiiuk
Copy link
Owner

Integrate with Google Drive API so that extension can store it's data there

@maxpatiiuk maxpatiiuk added the enhancement New feature or request label Sep 9, 2022
@maxpatiiuk
Copy link
Owner Author

maxpatiiuk commented Sep 25, 2022

Actually, integrating with Google Drive is not needed because extensions already have access to storage API - https://developer.chrome.com/docs/extensions/reference/storage/

Extensions can sync storage data between all devices, or keep data local.

There is a quota limit on the storage, but if we run out, there is a unlimitedStorage permission we can request

@Durbatuluk1701 Durbatuluk1701 self-assigned this Sep 26, 2022
@maxpatiiuk maxpatiiuk changed the title Integrate with Google Drive API Add a wrapper around Chrome Storage API Oct 1, 2022
@maxpatiiuk
Copy link
Owner Author

@Durbatuluk1701 Integrating with Google Drive API won't be needed.

But, we will need a cache layer to save the computed summary of how much time the user spent on a particular event in a given week

@Durbatuluk1701
Copy link
Collaborator

Durbatuluk1701 commented Oct 2, 2022

@maxpatiiuk Nice hopefully that should be simpler if I am understanding correctly?

@maxpatiiuk
Copy link
Owner Author

Yes!

Here is probably the best solution to this:

You could implement this using incremental synchronization - https://developers.google.com/calendar/api/guides/sync

I.e, our extension computes the stats for each day for every calendar for the last 4 years, and stores that locally.

Then, once an hour or once a day it recomputes the stats for the changed days using the calendar synchronization endpoint

Another solution:

Fetch data one day at a time. Save computed events locally. Assume that past events do not change, and thus can be cached forever. Don't cache future events as they are likely to change.

Also, need to figure out some cache busting strategy (or at least a "clear cache" button in the UI)

@Durbatuluk1701
Copy link
Collaborator

Durbatuluk1701 commented Oct 3, 2022 via email

@Durbatuluk1701
Copy link
Collaborator

CLosed by #80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants