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

Handling logs that were deleted on the server. #284

Open
jgaehring opened this issue Jan 7, 2020 · 3 comments
Open

Handling logs that were deleted on the server. #284

jgaehring opened this issue Jan 7, 2020 · 3 comments

Comments

@jgaehring
Copy link
Member

jgaehring commented Jan 7, 2020

From @alexadamsmith in #282 (comment)_

In addition to fixing the PUT issue, I think we will also need to work on handling deletions from the server. My feeling is, if the app finds that a log has been deleted from the server, the app should delete that log locally as well. What do you think about that @jgaehring and @mstenta ?

My response from the same issue thread:

I'm not sure deleting it is the best outcome in all possible scenarios. Perhaps if there are not changes made to that log since the last sync event. But if the user has made changes to it since the deletion has occurred, perhaps we want to clear the id field so it becomes a new log. Or perhaps we want to let the user decide somehow. I'm not sure.

@jgaehring
Copy link
Member Author

This should not be too hard, from a technical standpoint. I still think it comes down to either deleting the log locally or cloning it as a new log, without an id, so the server assigns it one upon the next sync (so a totally new log in every sense).

I'm not really willing to decide that, however, and I think the user's input is needed. Therefore, it would make sense to treat this along with #190, which is a little more than I want to get into during the 0.7.0 milestone. So I'm moving both issues to the 0.8.0 milestone.

For future reference, I believe the best place to start is in the syncErrorHandler, where we're currently doing nothing with 404's which is the servers response to any requests for a deleted log:

https://github.com/farmOS/farmOS-client/blob/3722e2ce0b777b8221b37327987713183481db45/src/core/store/http/index.js#L37-L41

@mstenta
Copy link
Member

mstenta commented Sep 8, 2020

Talked with @jgaehring about this today - we both agreed that we should punt on implementing any server delete options. We don't need (nor really want) it in the My Logs screen right now, and there is a fair bit of complexity to think about in specific use-cases. So, let's create a separate issue for it and mark it as "Postponed" for now... until a real use-case need comes up for it.

@jgaehring
Copy link
Member Author

Sounds good. I just quoted you over in #411.

Just for clarification, I'm leaving this open as it pertains to logs on the server that have been deleted from the server, not from Field Kit. We still need to handle that scenario as a form of merge conflict, as mentioned above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants