Skip to content
Snippets Groups Projects
Commit 539f0698 authored by Jono Wenger's avatar Jono Wenger
Browse files

Remove hackTestDb

parent 72b2ab22
No related branches found
No related tags found
2 merge requests!67fix for latest client release,!52XX-4382 / Move indexedDb databases to web workers
...@@ -176,31 +176,6 @@ func v1Upgrade(db *idb.Database) error { ...@@ -176,31 +176,6 @@ func v1Upgrade(db *idb.Database) error {
return nil return nil
} }
// hackTestDb is a horrible function that exists as the result of an extremely
// long discussion about why initializing the IndexedDb sometimes silently
// fails. It ultimately tries to prevent an unrecoverable situation by actually
// inserting some nonsense data and then checking to see if it persists.
// If this function still exists in 2023, god help us all. Amen.
func (w *wasmModel) hackTestDb() error {
testMessage := &Message{
ID: 0,
Nickname: "test",
MessageID: id.DummyUser.Marshal(),
}
msgId, helper := w.receiveHelper(testMessage, false)
if helper != nil {
return helper
}
result, err := indexedDb.Get(w.db, messageStoreName, js.ValueOf(msgId))
if err != nil {
return err
}
if result.IsUndefined() {
return errors.Errorf("Failed to test db, record not present")
}
return nil
}
// storeDatabaseName sends the database name to storage.StoreIndexedDb in the // storeDatabaseName sends the database name to storage.StoreIndexedDb in the
// main thread to be stored in localstorage and waits for the error to be // main thread to be stored in localstorage and waits for the error to be
// returned. // returned.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment