Skip to content
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

Concurrent CEDICT DB upgrades #6

Open
kirlat opened this issue Jan 15, 2020 · 1 comment
Open

Concurrent CEDICT DB upgrades #6

kirlat opened this issue Jan 15, 2020 · 1 comment

Comments

@kirlat
Copy link
Member

kirlat commented Jan 15, 2020

When two tabs are loading a Lexis service simultaneously for the first time in a browser, the IndexedDB storage for CEDICT data does not exist yet and two tabs will try to create it and download CEDICT data into it at the same time. The current version of LexisCS monitors this concurrency and prevents concurrent IndexedDB upgrade operations from happening.

The process in a tab that started first will continue with its DB creation and data downloading and all other processes will stop their own upgrades to avoid blocking each other. All the processes in tabs that were blocked will print the following message into the console:
A database change has occurred. You should refresh this browser window or close it down.
Once pages within those tabs will be reloaded the LexisCS functionality within them will become available.

The situation described above will not happen often, only when DB data needs to be downloaded or DB needs to be upgraded and two tabs with Alpheios active are loaded at the same time. I think it can be considered an edge case.

Would that be acceptable to treat this situation like described above or can we do anything better?

@kirlat
Copy link
Member Author

kirlat commented Jan 30, 2020

This is already implemented in the current version of LexisCS. If we're satisfied with how it is currently this issue can probably be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant