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

fix: report errors from automigrate/autoupdate (defer automigrate/autoupdate until we are connected) #1756

Merged
merged 1 commit into from Jul 4, 2019

Conversation

@bajtos
Copy link
Member

commented Jul 2, 2019

Defer automigrate/autoupdate until we are connected, so that connection errors can be reported back to callers.

Fix postInit handler to not report connection error to console.log and via dataSource "error" event in case there is already an operation queued. When this happens, we want the error to be handled by the queued operation and reported to its caller.

Related issues

Checklist

  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style
    guide

@bajtos bajtos added the bug label Jul 2, 2019

@bajtos bajtos requested review from raymondfeng, hacksparrow and strongloop/loopback-3x-maintainers Jul 2, 2019

@bajtos bajtos self-assigned this Jul 2, 2019

@bajtos bajtos referenced this pull request Jul 2, 2019
0 of 1 task complete
lib/datasource.js Outdated Show resolved Hide resolved
@hacksparrow
Copy link
Member

left a comment

LGTM except for that typo

@bajtos bajtos force-pushed the fix/migrate-errors branch 2 times, most recently from 016dd58 to dea001f Jul 2, 2019

@b-admike
Copy link
Member

left a comment

Nice. One comment, otherwise LGTM.

test/datasource.test.js Outdated Show resolved Hide resolved
fix: report errors from automigrate/autoupdate
Defer automigrate/autoupdate until we are connected, so that connection
errors can be reported back to callers.

Fix postInit handler to not report connection error to console.log
and via dataSource "error" event in case there is already an operation
queued. When this happens, we want the error to be handled by the
queued operation and reported to its caller.

Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>

@bajtos bajtos force-pushed the fix/migrate-errors branch from dea001f to 40286fc Jul 4, 2019

@bajtos

This comment has been minimized.

Copy link
Member Author

commented Jul 4, 2019

@slnode test please

@bajtos bajtos merged commit 0c2bb81 into master Jul 4, 2019

15 of 18 checks passed

[cis-jenkins] PR Builder Build finished.
Details
[cis-jenkins] downstream: loopback-connector-cloudant@master Failed! (40286fc)
Details
[cis-jenkins] downstream: loopback-connector-postgresql@master Failed! (40286fc)
Details
Commit Linter commits are all properly formatted
Details
PR Linter PR is up to date
Details
[cis-jenkins] downstream: loopback-connector-kv-redis@master Success! (40286fc)
Details
[cis-jenkins] downstream: loopback-connector-mongodb@master Success! (40286fc)
Details
[cis-jenkins] x64 && linux && nvm,10 Success! (40286fc)
Details
[cis-jenkins] x64 && linux && nvm,8 Success! (40286fc)
Details
clahub All contributors have signed the Contributor License Agreement.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.1%) to 84.568%
Details
loopback-datasource-juggler Success! (40286fc)
Details
loopback-datasource-juggler/node=4.x,os=windows Success! (40286fc)
Details
loopback-datasource-juggler/node=6.x,os=windows Success! (40286fc)
Details
pr-builder
Details
security/snyk - package.json (StrongLoop) No manifest changes detected

@delete-merged-branch delete-merged-branch bot deleted the fix/migrate-errors branch Jul 4, 2019

@bajtos bajtos changed the title fix: report errors from automigrate/autoupdate fix: report errors from automigrate/autoupdate (defer automigrate/autoupdate until we are connected) Jul 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.