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
Showing only changes of commit f407708cfe - Show all commits

View File

@ -1,5 +1,5 @@
v0l commented 2023-01-23 13:30:52 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-23 13:30:52 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 10:03:35 +00:00 (Migrated from github.com)
Review

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

This seems to create an empty database and not store anything inside?
v0l commented 2023-01-25 10:03:35 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 16:57:56 +00:00 (Migrated from github.com)
Review

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?
verbiricha commented 2023-01-25 16:57:56 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 17:33:25 +00:00 (Migrated from github.com)
Review

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
v0l commented 2023-01-25 17:33:25 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-27 09:06:04 +00:00 (Migrated from github.com)
Review

My bad, 59878776d5 should fix it

My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
verbiricha commented 2023-01-27 09:06:04 +00:00 (Migrated from github.com)
Review

My bad, 59878776d5 should fix it

My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
import { HexKey } from "Nostr"; import { HexKey } from "Nostr";
import { db as idb, NAME, VERSION } from "Db"; import { db as idb } from "Db";
v0l commented 2023-01-23 13:30:52 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 10:03:35 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 16:57:56 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 17:33:25 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-27 09:06:04 +00:00 (Migrated from github.com)
Review

My bad, 59878776d5 should fix it

My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
v0l commented 2023-01-23 13:30:52 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 10:03:35 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 16:57:56 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 17:33:25 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-27 09:06:04 +00:00 (Migrated from github.com)
Review

My bad, 59878776d5 should fix it

My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
import { UsersDb, MetadataCache, setUsers } from "State/Users"; import { UsersDb, MetadataCache, setUsers } from "State/Users";
import store from "State/Store"; import store from "State/Store";
@ -8,7 +8,7 @@ class IndexedDb implements UsersDb {
v0l commented 2023-01-23 13:30:52 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-23 13:30:52 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 10:03:35 +00:00 (Migrated from github.com)
Review

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

This seems to create an empty database and not store anything inside?
v0l commented 2023-01-25 10:03:35 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 16:57:56 +00:00 (Migrated from github.com)
Review

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?
verbiricha commented 2023-01-25 16:57:56 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 17:33:25 +00:00 (Migrated from github.com)
Review

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
v0l commented 2023-01-25 17:33:25 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-27 09:06:04 +00:00 (Migrated from github.com)
Review

My bad, 59878776d5 should fix it

My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
verbiricha commented 2023-01-27 09:06:04 +00:00 (Migrated from github.com)
Review

My bad, 59878776d5 should fix it

My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
isAvailable() { isAvailable() {
if ("indexedDB" in window) { if ("indexedDB" in window) {
return new Promise<boolean>((resolve) => { return new Promise<boolean>((resolve) => {
const req = window.indexedDB.open(NAME, VERSION) const req = window.indexedDB.open("dummy", 1)
v0l commented 2023-01-23 13:30:52 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 10:03:35 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 16:57:56 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 17:33:25 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-27 09:06:04 +00:00 (Migrated from github.com)
Review

My bad, 59878776d5 should fix it

My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
v0l commented 2023-01-23 13:30:52 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 10:03:35 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 16:57:56 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 17:33:25 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-27 09:06:04 +00:00 (Migrated from github.com)
Review

My bad, 59878776d5 should fix it

My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
req.onsuccess = (ev) => { req.onsuccess = (ev) => {
resolve(true) resolve(true)
} }

v0l commented 2023-01-23 13:30:52 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-23 13:30:52 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 10:03:35 +00:00 (Migrated from github.com)
Review

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

This seems to create an empty database and not store anything inside?
v0l commented 2023-01-25 10:03:35 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 16:57:56 +00:00 (Migrated from github.com)
Review

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?
verbiricha commented 2023-01-25 16:57:56 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-25 17:33:25 +00:00 (Migrated from github.com)
Review

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
v0l commented 2023-01-25 17:33:25 +00:00 (Migrated from github.com)
Review

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 commented 2023-01-27 09:06:04 +00:00 (Migrated from github.com)
Review

My bad, 59878776d5 should fix it

My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it
verbiricha commented 2023-01-27 09:06:04 +00:00 (Migrated from github.com)
Review

My bad, 59878776d5 should fix it

My bad, https://github.com/v0l/snort/pull/110/commits/59878776d5a377e62937d1120c3b73a011a91c95 should fix it