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

Comments: Add an Update Note API #26

Closed
jayair opened this issue Apr 10, 2017 · 12 comments

Comments

Projects
None yet
5 participants
@jayair
Copy link
Member

commented Apr 10, 2017

@jayair jayair added the Discussion label Apr 10, 2017

@oluckyman

This comment has been minimized.

Copy link

commented Apr 16, 2017

why use
ReturnValues: 'ALL_NEW',
if the response returns success: true only?

@fwang

This comment has been minimized.

Copy link
Member

commented Apr 16, 2017

You are totally right. We are not using the results any where in the code. It is in there in case users want to inspect the return value just for learning purposes.

Feel free to set ReturnValues to 'NONE' or remove the line.

@oluckyman

This comment has been minimized.

Copy link

commented Apr 16, 2017

@walshe

This comment has been minimized.

Copy link

commented Jan 17, 2018

wouldn't it be a good idea to use a 'version' field for an optimistic locking approach ?

@jayair

This comment has been minimized.

Copy link
Member Author

commented Jan 19, 2018

@walshe Do you mean a version to keep track of the edits made to a note? You can definitely do that! We are just keeping it fairly simple in the tutorial.

@walshe

This comment has been minimized.

Copy link

commented Jan 19, 2018

@jayair not exactly, I am talking about handling concurrent updates, so that if an entity has changed between the time it takes someone to read and update the entity then the update would fail similar to an 'update x set a=, b=,c= where version='

@jayair

This comment has been minimized.

Copy link
Member Author

commented Jan 19, 2018

@walshe Oh yeah I see what you are saying. That is definitely a good idea. I think we could cover it in an advanced chapter maybe?

For anybody else reading this; if two users are editing the same note, one could overwrite the other since we simply update the note with the passed in content. By adding a version field we can ensure that the note we are editing is the current version of it (as opposed to one that has already been updated in Dynamo).

@walshe

This comment has been minimized.

Copy link

commented Jan 20, 2018

yeah I think you just need a condition expression in the update

@allasandeep

This comment has been minimized.

Copy link

commented Mar 24, 2018

I am getting this error, can anyone help me?

serverless invoke local --function update --path mocks/update-event.json

  Y A M L Exception --------------------------------------

  duplicated mapping key in "C:\Users\gayat\Desktop\project-app-api\serverless.yml" at line 75, column 5:
        handler: update.main
        ^

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Forums:        forum.serverless.com
     Chat:          gitter.im/serverless/serverless

  Your Environment Information -----------------------------
     OS:                     win32
     Node Version:           8.10.0
     Serverless Version:     1.26.1
@jayair

This comment has been minimized.

Copy link
Member Author

commented Mar 26, 2018

@allasandeep Yeah it seems related to your serverless.yml not being formatted properly. Can you post it here?

@allasandeep

This comment has been minimized.

Copy link

commented Mar 26, 2018

@jayair jayair closed this May 9, 2018

@jayair jayair reopened this May 9, 2018

@jayair

This comment has been minimized.

Copy link
Member Author

commented May 9, 2018

@jayair jayair closed this May 9, 2018

jayair added a commit that referenced this issue Nov 1, 2018

Explanation of ReturnValues in the Update Note API (#290)
Absent any discussion, like the context given in #26, the presence of ReturnValues and the never-used result assignment may look like an error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.