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

#17 Modified reclaim to run on original engine with tests #21

Merged

Conversation

Dahaden
Copy link
Contributor

@Dahaden Dahaden commented Aug 5, 2020

This PR aims at fixing issue #17 by allowing the reclaim mechanism to run on the original engine and not the inmemory engine

@@ -276,7 +276,7 @@ Queue.prototype._checkReclaim = function() {

function findOtherQueues(name) {
var res = [];
var storage = self._store.engine;
var storage = self._store.getOriginalEngine();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: One of the scenarios that triggers a switch to the in memory engine is a failure to getItem from localStorage, for example if a user has blocked localStorage access to a particular domain.
In this scenario how do we handle failures to get the reclaim and ack etc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getItem just returns null if there is an error (ref). The check to see if we can get items from localStorage happens inside of the engine (ref).

This means that if the user has blocked localStorage, the initial defaultEngine will be inMemory. This will mean that this code path will work as expected.

@Dahaden
Copy link
Contributor Author

Dahaden commented Aug 10, 2020

No idea why this is failing in CI :(
When running locally, all the tests pass, same with lint, but the test hangs and requires me to crtl-c back to the terminal

@pooyaj
Copy link

pooyaj commented Aug 10, 2020

@Dahaden will try to get this reviewed. Also don't worry about the CI, the configuration is outdated and need some attention on our side.

@bryanmikaelian bryanmikaelian self-assigned this Aug 11, 2020
@bryanmikaelian
Copy link
Contributor

bryanmikaelian commented Aug 11, 2020

@Dahaden just checked this out locally and LGTM! We can merge this and I'll cut a new release.

We're also aware CircleCI is busted (this library is using 1.0!) as FYI

@bryanmikaelian bryanmikaelian merged commit a2ce7ab into segmentio:master Aug 11, 2020
@Dahaden
Copy link
Contributor Author

Dahaden commented Aug 12, 2020

Thank you very much @bryanmikaelian ! This is amazing!

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

Successfully merging this pull request may close these issues.

4 participants