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

[AsyncStorage] multiGet breaking test and fix #5514

Closed
wants to merge 2 commits into from

Conversation

mvayngrib
Copy link
Contributor

the flush + optimized multiGet result in an obscure bug that results when two multiGet requests with overlapping key sets get issued. The result array for both requests ends up bigger than the key array (because it has duplicates)

@facebook-github-bot
Copy link
Contributor

By analyzing the blame information on this pull request, we identified @sahrens, @vjeux and @nicklockwood to be potential reviewers.

@facebook-github-bot facebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Jan 24, 2016
@facebook-github-bot
Copy link
Contributor

@mvayngrib updated the pull request.

@mvayngrib mvayngrib changed the title [AsyncStorage] multiGet breaking test [AsyncStorage] multiGet breaking test and fix Jan 24, 2016
// avoid fetching duplicates
keys.forEach(key => {
if (this._getKeys.indexOf(key) === -1) {
this._getKeys.push(key)

Choose a reason for hiding this comment

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

semi: Missing semicolon.

@facebook-github-bot
Copy link
Contributor

@mvayngrib updated the pull request.

@@ -225,7 +228,12 @@ var AsyncStorage = {
});

this._getRequests.push(getRequest);
this._getKeys.push.apply(this._getKeys, keys);
// avoid fetching duplicates
keys.forEach(key => {

Choose a reason for hiding this comment

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

semi: Missing semicolon.

@facebook-github-bot
Copy link
Contributor

@mvayngrib updated the pull request.

@satya164
Copy link
Contributor

cc @vjeux

@niftylettuce
Copy link
Contributor

To anyone else that experiences this bug and is on an older version with unpatched AsyncStorage - you could just swap out your import { AsyncStorage} from 'react-native'; with import AsyncStorage from './async-storage.js' and then download this file to your root dir (or wherever you store helper libs/functions)https://gist.github.com/niftylettuce/a1a842384665c7c000c7

@niftylettuce
Copy link
Contributor

@mvayngrib thanks so much btw

@mvayngrib
Copy link
Contributor Author

@niftylettuce you're welcome :)

@nicklockwood
Copy link
Contributor

@facebook-github-bot shipit

@facebook-github-bot
Copy link
Contributor

Thanks for importing. If you are an FB employee go to https://our.intern.facebook.com/intern/opensource/github/pull_request/1753159551581590/int_phab to review.

@ghost ghost closed this in 52755fd Feb 6, 2016
bestander pushed a commit that referenced this pull request Feb 15, 2016
Summary:
the flush + optimized multiGet result in an obscure bug that results when two multiGet requests with overlapping key sets get issued. The result array for both requests ends up bigger than the key array (because it has duplicates)
Closes #5514

Reviewed By: svcscm

Differential Revision: D2908264

Pulled By: nicklockwood

fb-gh-sync-id: 60be1bce4acfc47083e4ae28bb8b63f9dfa56039
pglotov pushed a commit to pglotov/react-native that referenced this pull request Mar 15, 2016
Summary:
the flush + optimized multiGet result in an obscure bug that results when two multiGet requests with overlapping key sets get issued. The result array for both requests ends up bigger than the key array (because it has duplicates)
Closes facebook#5514

Reviewed By: svcscm

Differential Revision: D2908264

Pulled By: nicklockwood

fb-gh-sync-id: 60be1bce4acfc47083e4ae28bb8b63f9dfa56039
Corey-Peyton added a commit to Corey-Peyton/async-storage that referenced this pull request Jul 14, 2021
Summary:
the flush + optimized multiGet result in an obscure bug that results when two multiGet requests with overlapping key sets get issued. The result array for both requests ends up bigger than the key array (because it has duplicates)
Closes facebook/react-native#5514

Reviewed By: svcscm

Differential Revision: D2908264

Pulled By: nicklockwood

fb-gh-sync-id: 60be1bce4acfc47083e4ae28bb8b63f9dfa56039
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants