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

API: let the modified time be changeable #4

Merged
merged 1 commit into from
Dec 1, 2016
Merged

Conversation

korelstar
Copy link
Member

@korelstar korelstar commented Oct 24, 2016

It will close owncloud/notes#247:

If a note is created/edited using a 3rd-party app, this can be done in offline mode. Therefore, there can be a time difference between editing the note on the client and putting the changed data to the server through the API. However, the modified time will be set to the time when putting the data to the server.

This behavior can be confusing for the user, since the shown modified time does not reflect what (when) the user did.

I propose to extend the API and introduce a new optional field modified which can be passed when creating or updating a note, beside content.

Tasks

  • API: let the modified time be changeable
  • API: allow setting favorites in create, refactoring

@Henni
Copy link
Member

Henni commented Oct 24, 2016

Note to myself: this also adds favorite functionality

* @param boolean $favorite
* @return DataResponse
*/
public function update($id, $content=null, $favorite=null) {
public function update($id, $content=null, $modified=0, $favorite=null) {
Copy link
Member

Choose a reason for hiding this comment

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

What happens if this defaults to 0?

Copy link
Member Author

Choose a reason for hiding this comment

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

If modified is not stated in the request, the behavior is the same as before of my changes: the mtime of the note's file is set to the current date/time.

Therefore, my changes of the API are totally backward compatible. However, the API documentation has to be revised. But the wiki has not been transferred, yet.

Copy link
Member

Choose a reason for hiding this comment

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

👍

@korelstar korelstar force-pushed the api-changeable-modified branch from 96f7598 to 7d914c8 Compare October 26, 2016 13:53
@korelstar korelstar changed the title [WIP] API: let the modified time be changeable API: let the modified time be changeable Oct 26, 2016
@korelstar
Copy link
Member Author

I'm done -- from my site, this can be merged.

@Henni
Copy link
Member

Henni commented Oct 26, 2016

Looks good to me.
@stefan-niedermann would you like to take a look, as this affects your awesome app.

@stefan-niedermann
Copy link
Member

Yeap, i have already subscribed this issue :) Will have a look at implementation when i have some free time

@korelstar
Copy link
Member Author

Can this be merged, now?

@Henni
Copy link
Member

Henni commented Dec 1, 2016

@stefan-niedermann ping

@stefan-niedermann
Copy link
Member

LGTM 👍
Ready to merge from my point of view 😃

@Henni Henni merged commit a8d91de into master Dec 1, 2016
@Henni Henni deleted the api-changeable-modified branch December 1, 2016 20:26
@Henni
Copy link
Member

Henni commented Dec 1, 2016

Awesome! Happy we got this in! 🎉

@korelstar korelstar added the feature: API Related to the API for 3rd-party apps, i.e. Android or iOS label Jan 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature: API Related to the API for 3rd-party apps, i.e. Android or iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API: let the modified time be changeable
3 participants