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

allow search to occur if "near me" request fails #1668

Merged
merged 3 commits into from
Feb 14, 2022

Conversation

yen-tt
Copy link
Contributor

@yen-tt yen-tt commented Feb 11, 2022

this pr update the middleware function promptForLocation to gracefully handle rejected promises related to fetching near me intents or getting user location.

If fails, a search request should still get executed. To do so, catch in the then() call chain to handle rejected promise cases and provide a console warn message. Since the handler function doesn't return anything, the promise returned by then gets resolved with an undefined value.

J=SLAP-1885
TEST=manual

return a rejected promise for fetchQueryIntents function to mock a failed autocomplete request to compute near me intents. See that a console warn message appear indicating the error, but the search is still executed and see that results for the query is shown on page.

@coveralls
Copy link

coveralls commented Feb 11, 2022

Coverage Status

Coverage increased (+0.009%) to 61.289% when pulling 2472e47 on dev/bypass-fail-nearme-request into 9aa76ef on develop.

@yen-tt yen-tt added the WIP Work in progress label Feb 14, 2022
@yen-tt yen-tt removed the WIP Work in progress label Feb 14, 2022
@yen-tt yen-tt merged commit 81fe307 into develop Feb 14, 2022
@yen-tt yen-tt deleted the dev/bypass-fail-nearme-request branch February 14, 2022 16:00
@yen-tt yen-tt restored the dev/bypass-fail-nearme-request branch February 14, 2022 20:09
yen-tt added a commit that referenced this pull request Feb 14, 2022
yen-tt added a commit that referenced this pull request Feb 14, 2022
)

Reverts #1668

will be merge in hotfix branch 1.12.2 instead. Will be removing the first onReject handler function since this pr (#1669) already handle it.
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.

None yet

3 participants