feat: in-memory fallback for storing user profiles #110

Merged
verbiricha merged 17 commits from dbfix into main 2023-01-27 21:38:42 +00:00
verbiricha commented 2023-01-21 13:16:49 +00:00 (Migrated from github.com)

Visit https://dbfix.snort-social.pages.dev/ with Tor

resolves #72

Visit https://dbfix.snort-social.pages.dev/ with Tor resolves #72
v0l (Migrated from github.com) reviewed 2023-01-21 14:25:09 +00:00
v0l (Migrated from github.com) commented 2023-01-21 14:25:05 +00:00

This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a const SnortDb we can have const db = SnortDb | ReduxDb which both implement the users store, no need for try/catch then

At startup we can test if indexdDb is available with window.indexdDb.open("test").catch(() => "Not supported") or something similar, at this point we initialize the db to be ReduxDb which implements UsersDb or some other interface

This is great, i think we can improve it one more way, if we create an interface which defines these methods, then instead of using try/catch with a `const SnortDb` we can have `const db = SnortDb | ReduxDb` which both implement the users store, no need for try/catch then At startup we can test if indexdDb is available with `window.indexdDb.open("test").catch(() => "Not supported")` or something similar, at this point we initialize the `db` to be `ReduxDb` which implements `UsersDb` or some other interface
v0l (Migrated from github.com) reviewed 2023-01-23 09:44:56 +00:00
v0l (Migrated from github.com) commented 2023-01-23 09:44:56 +00:00

Hey if you dont have time to make these changes maybe lets just merge it now and work on it later

Hey if you dont have time to make these changes maybe lets just merge it now and work on it later
cloudflare-pages[bot] commented 2023-01-23 12:36:38 +00:00 (Migrated from github.com)

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: beeb6e6
Status:   Deploy successful!
Preview URL: https://9d145b48.snort-social.pages.dev
Branch Preview URL: https://dbfix.snort-social.pages.dev

View logs

## Deploying with &nbsp;<a href="https://pages.dev"><img alt="Cloudflare Pages" src="https://user-images.githubusercontent.com/23264/106598434-9e719e00-654f-11eb-9e59-6167043cfa01.png" width="16"></a> &nbsp;Cloudflare Pages <table><tr><td><strong>Latest commit:</strong> </td><td> <code>beeb6e6</code> </td></tr> <tr><td><strong>Status:</strong></td><td>&nbsp;✅&nbsp; Deploy successful!</td></tr> <tr><td><strong>Preview URL:</strong></td><td> <a href='https://9d145b48.snort-social.pages.dev'>https://9d145b48.snort-social.pages.dev</a> </td></tr> <tr><td><strong>Branch Preview URL:</strong></td><td> <a href='https://dbfix.snort-social.pages.dev'>https://dbfix.snort-social.pages.dev</a> </td></tr> </table> [View logs](https://dash.cloudflare.com/?to=/:account/pages/view/snort-social/9d145b48-8c7c-4bf3-81fc-a2639cd4c1da)
v0l (Migrated from github.com) reviewed 2023-01-23 12:43:49 +00:00
v0l (Migrated from github.com) commented 2023-01-23 12:43:41 +00:00

db.find?

`db.find`?
v0l (Migrated from github.com) reviewed 2023-01-23 13:33:21 +00:00
v0l (Migrated from github.com) left a comment

There seems to be some subscription spam now on global, need to be careful about how we modify state to prevent rebuilding feeds
image

There seems to be some subscription spam now on global, need to be careful about how we modify state to prevent rebuilding feeds ![image](https://user-images.githubusercontent.com/1172179/214052410-58753c4e-4c6d-49e5-b6a0-51af93850195.png)
v0l (Migrated from github.com) commented 2023-01-23 13:30:52 +00:00

Might as well try to open the SnortDb so we dont have a random "test" db be there forever

Might as well try to open the SnortDb so we dont have a random "test" db be there forever
v0l (Migrated from github.com) approved these changes 2023-01-25 09:59:12 +00:00
v0l (Migrated from github.com) reviewed 2023-01-25 10:03:38 +00:00
v0l (Migrated from github.com) commented 2023-01-25 10:03:35 +00:00

This seems to create an empty database and not store anything inside?

This seems to create an empty database and not store anything inside?
verbiricha (Migrated from github.com) reviewed 2023-01-25 16:57:56 +00:00
verbiricha (Migrated from github.com) commented 2023-01-25 16:57:56 +00:00

I'll go back to using a dummy test db with version 1 then, wdyt?

I'll go back to using a dummy `test` db with version 1 then, wdyt?
v0l (Migrated from github.com) reviewed 2023-01-25 17:33:25 +00:00
v0l (Migrated from github.com) commented 2023-01-25 17:33:25 +00:00

Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there

Still doesnt seem to actually use IndexdDb, in logs it says its using indexdb but its not storing anything there
verbiricha (Migrated from github.com) reviewed 2023-01-27 09:06:05 +00:00
verbiricha (Migrated from github.com) commented 2023-01-27 09:06:04 +00:00

My bad, 59878776d5 should fix it

My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
Sign in to join this conversation.
No description provided.