Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xxdk-wasm
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
xxdk-wasm
Commits
0f7c37ee
Commit
0f7c37ee
authored
2 years ago
by
Jake Taylor
Browse files
Options
Downloads
Patches
Plain Diff
force indexeddb to close and open after creation
parent
f4db0a78
No related branches found
No related tags found
2 merge requests
!60
Revert "Fail a test to be sure it works"
,
!19
force indexeddb to close and open after creation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indexedDb/init.go
+21
-0
21 additions, 0 deletions
indexedDb/init.go
with
21 additions
and
0 deletions
indexedDb/init.go
+
21
−
0
View file @
0f7c37ee
...
...
@@ -87,6 +87,27 @@ func newWASMModel(databaseName string, cb MessageReceivedCallback) (
// Wait for database open to finish
db
,
err
:=
openRequest
.
Await
(
ctx
)
if
err
!=
nil
{
return
nil
,
err
}
// Close and open again to ensure the state is finalized
err
=
db
.
Close
()
if
err
!=
nil
{
return
nil
,
err
}
openRequest
,
err
=
idb
.
Global
()
.
Open
(
ctx
,
databaseName
,
currentVersion
,
func
(
db
*
idb
.
Database
,
oldVersion
,
newVersion
uint
)
error
{
return
nil
})
if
err
!=
nil
{
return
nil
,
err
}
// Wait for database open to finish
db
,
err
=
openRequest
.
Await
(
ctx
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
wasmModel
{
db
:
db
,
receivedMessageCB
:
cb
},
err
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment