-
Notifications
You must be signed in to change notification settings - Fork 29
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
feat: πΈ Add migration check to delete index DB when updating #2241
base: main
Are you sure you want to change the base?
feat: πΈ Add migration check to delete index DB when updating #2241
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
get db() { | ||
return this.#db; | ||
} | ||
|
||
setup(dbName) { | ||
async setup(dbName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems on initial login (not from an authentication restoration) some requests are firing off before index db is properly setup.
I was suspicious that the session service I override here can't actually be async since it seems the source code doesn't take into account if the overridable method needs to be async. The setup call in the service should be awaited but it didn't seem to make a difference.
I tried setting up indexed DB in our authenticate method before any transition but it seems like for some reason ember still fires off requests for scopes before index DB is ready.
I'm not sure what the solution is as it seems the moment the setup
method is async, this scope request isn't properly awaiting now.
f496414
to
32dda29
Compare
32dda29
to
57a7e98
Compare
777551e
to
af77cc4
Compare
Some notes related to this comment in the pr where there's a race condition between getting an indexeddb setup and then making calls that are use the db for caches. The goal is to deterministically Here are some possible solutions toe ensure that the 1. Instead of routing ourselves, route within
|
Here's a branch based on suggestion 1 above |
β Closes: https://hashicorp.atlassian.net/browse/ICU-13223
ποΈ Jira ticket
Description
This PR aims to prevent any migration that might be needed in the future for indexed DB by destroying the previous DB if a version is detected.
There seems to some weird async behavior happening in the setup when we have to await some dexie methods.
Screenshots (if appropriate):
How to Test
Increment the version of index DB and confirm it correctly deletes previous tables and sets up a fresh instance.
Checklist:
[ ] I have added before and after screenshots for UI changes[ ] I have added JSON response output for API changes[ ] I have added steps to reproduce and test for bug fixes in the description[ ] I have added tests that prove my fix is effective or that my feature works