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

Extension should be able to download and use new approved slur list from the uli-community server #650

Open
dennyabrain opened this issue Jan 19, 2025 · 3 comments
Assignees

Comments

@dennyabrain
Copy link
Contributor

dennyabrain commented Jan 19, 2025

Prior Discussion : #237 (comment)

@dennyabrain
Copy link
Contributor Author

When we first implemented persistence for local slur list, the only querying pattern was to get the entire list and save an entire list of strings. LocalStorage worked so far because we were dealing with only strings but now new feature requests have emerged that justifies looking for a better storage mechanism. Some that I can think of are :

  1. Maintain uniqueness of slurs when combining slurs from multiple sources - hard coded list, user's local list, public list from uli community
  2. @maanasb01 mentioned that we could allow users to enable/disable a certain slur if they don't find it problematic
  3. Local Storage have size limits of 5 MB. Now the slur list could grow with community contributions. We could also consider cache slur metadata locally to decrease pings to our server. Both suggest looking at a different storage mechanism.
  4. With large amount of data, one wants to filter and query it. String might not be the best datastructure for it.

I am proposing exploring IndexedDB, a browser API for storing data persistently. There are also libraries like Dexie.js that make it easy work with indexedDB. Lets start by evaluating the feasibility of using this as a solution.

@dennyabrain
Copy link
Contributor Author

dennyabrain commented Jan 20, 2025

Goals for the Analysis

  1. Is IndexedDB supported on all modern browers
  2. Does IndexedDB provide constraints like unique
  3. How do you query/filter data
  4. Do extensions have access to IndexedDB
  5. List down all functions your module will expose. I can think of add_slur, get_slur(label), update_status(label).

notes

  1. compatible with all widely used browsers - https://developer.mozilla.org/en-US/docs/Web/API/Window/indexedDB#browser_compatibility

@aatmanvaidya
Copy link
Collaborator

aatmanvaidya commented Jan 22, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants