-
Notifications
You must be signed in to change notification settings - Fork 74
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
FeathersJS Inserts 2 records into MySql from 1 REST call #321
Comments
I can't see this happening by default so a complete example to reproduce would be the best way to be able to look into it. |
dumb question, but have you turned on the sequelize debugging? then you
will see all the SQL statements.
Thank you,
Mark Edwards
…On Sun, Sep 22, 2019 at 6:12 PM David Luecke ***@***.***> wrote:
I can't see this happening by default so a complete example to reproduce
would be the best way to be able to look into it.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#321?email_source=notifications&email_token=AAWJ3YUM5OBML2KDYU3MNN3QLAJXDA5CNFSM4IXPTW4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7JTQLQ#issuecomment-533936174>,
or mute the thread
</~https://github.com/notifications/unsubscribe-auth/AAWJ3YUSTW55YYLVOL4VXWTQLAJXDANCNFSM4IXPTW4A>
.
|
Yup, that shows 2 inserts, or, as I am seeing today too, 2 UPDATE statements. This log block shows what happens with one call from
|
This looks like a mistake somewhere in your application logic but it's difficult to say without a complete example to reproduce the issue. |
ok, thank you. I'll try and make a slimmed down single model version of my app to put on github. |
weird - is there some issue with an ALL hook that is being executed twice
or something like that?
Thank you,
Mark Edwards
…On Tue, Sep 24, 2019 at 11:21 AM Jason Wilson ***@***.***> wrote:
This looks like a mistake somewhere in your application logic but it's
difficult to say without a complete example to reproduce the issue.
ok, thank you. I'll try and make a slimmed down single model version of my
app to put on github.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#321?email_source=notifications&email_token=AAWJ3YRQUZQKVCALGCTMFQTQLJLCPA5CNFSM4IXPTW4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7PKMEY#issuecomment-534685203>,
or mute the thread
</~https://github.com/notifications/unsubscribe-auth/AAWJ3YWZWWBXIEIW633GJ7LQLJLCPANCNFSM4IXPTW4A>
.
|
Thank you everyone for your help. I found the issue.
To:
|
When I use the .create(item) method to do an INSERT from the client (within the browser) I see 1 call via websocket or REST go to feathersjs. I see one request go into Feathersjs. For an unknown reason I see 2 rows created in MySql and 2 lines in the log that say: {"message":"after: name_of_service - Method: create","level":"info"}
Using sequelize 4.42.0 and feathers-sequelize 6.0.1
I do not have the issue when running create() from within the server code, only from client.
I found feathersjs-ecosystem/feathers-rethinkdb#80 that looked simular but is for a different DB and the explanation did not fit with MySql.
I switched to MariaDB for other reasons but obviously nothing changed.
I was using FeathersJS v3.x and upgrading to v4.x to see if that would fix it. Nope. As I work around I have been making my own insert methods but it would be nice to use the built in ones.
I tried switching between REST and websocket.
My Hooks:
Service:
I expected it to insert 1 row in MySql table. But got 2. I expected one row in the log for the after hook, but see 2. This has been happening for a couple of months and was thinking, hey, maybe I am not the only one.
The text was updated successfully, but these errors were encountered: