-
Notifications
You must be signed in to change notification settings - Fork 135
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
Modified date/time is not updated when a note is renamed. #621
Comments
Could you verify that the |
I don't think I have access to an ETag via the api do I ? If not, I possibly cannot verify it. |
ETags are used to verify that something has changed on the server side. You can imagine it as an hash over the http response. you send the hash in your next request as value of an See the Notes API documentation and more information about ETags. This is better as relying on the modified date, because in some situations one doesn't want to change the modified date. For example this would cause a order change when one ordered the notes by modified date, but this isn't actually wanted behavior. Other scenarios might be "marking a note as favorite" - i wouldn't expect an updated modified date here, as it would cause a sort order change. |
OK, I reckon I can modify my code to read the etag but will need a bit of time to do so. But that really won't help. It won't tell me which note/notes has changed. We need to have something that is a clear indicator that a particular server note is in need of being synced, if its not modified time, then what is it ? If i am to rely on the eTag, and I get a non-match, I would need to download all the notes and compare them with local notes. Given that I have users with tens of thousands of notes, I really don't think thats a viable approach. blue sky mode on : Davo |
You can combine the ETag with the |
Maybe the maintainer @korelstar can provide some help? |
Maybe ? The API docs do say that a GET can return 200, 400, 401, 404, an It would work but I'd need to repeat the GET for each and every note every time the ETag failed. And the API already seems pretty slow. I assume korelstar watches this list ? Davo |
Sorry for the late reply. Like @stefan-niedermann said, the modified time is not a technical time. It does not change if only meta data (like category, title, favorite) was changed. Therefore, you can't use this attribute for detecting changes. Furthermore, it's true that we don't expose an ETag for single notes, currently. And we also did not implemented Instead you can use the parameter |
OK, I guess that makes sense then. Are there plans to develop the API in the future ? if so, I could make a couple of constructive suggestions. Firstly, use of pruneBefore, if there is a lot of notes (I have many users with 20K+ notes) and a large number of them change, its a huge download all at once. Difficult to manage errors. And it struggles when both local and NextCloud versions of a note have changed, I still need to present a last change date to to the user who has to decide how to handle the clash. Secondly, identifying notes - if a note is assigned a unique ID it would make the system far more portable. At present, if a user, for example, moves their notes to a new install of NextCloud (or a new provider etc) a synced system cannot tell that the presented notes are the same ones it already has, this results in duplication, a major problem in any sync system. In the Tomboy world, we assign a UUID. In tomboy-ng, I use the last change date to determine that a pair of notes (with the same ID) are identical or not. Anyway, thanks for the advice on pruneBefore, I will look at how that fits into the Tomboy model. Davo |
Feedback is always welcome and of course, we can change the API if this is required. You are talking about three different points: 1. Limit list of notesIndeed, this would be a nice feature, especially for the first synchronization where all notes have to be downloaded and saved locally. I can imagine that we could add a cursor-based pagination for this. However, we have to ensure that the client still detects removed notes immediately. I suggest that we create a new issue (feature-request) for this aspect after you've successfully tested/implemented the 2. Handling conflictsThis is a very important topic. I've written down some thoughts on this a long time ago, see #56. However, this is strongly related to #331, which could require a totally different solution for the API. Because of this, there is not much progress on this. But it's on our agenda, we just need some time to realize this. 3. static UUIDs for notesI see the advantage of this approach. However, I'm not sure if it is possible to implement this in the Nextcloud eco-system. Notes are saved as files in Nextcloud. Therefore, if you migrate your notes to another Nextcloud server, you will move your files to that server. Hence, the UUID would must be saved in that file. This could be either the file name or the file content. Both is error-prone and unintentionally for users who use file synchronization and edit their notes manually (e.g. with the desktop system editor). Currently, for other third-party apps, migration to another Nextcloud server works as follow: The client synchronizes with the server so that there are no local changes. Then, the client changes the URL of the Nextcloud server and synchronizes again. Now, the client removes all local notes (with obsolete ID) and downloads the notes from the server (with new ID). In your implementation, you can even do a heuristic to match old IDs to new IDs (e.g. by using title and category). |
OK, sorry I have taken so long with this, life tends to get in the way ... Yep, as you suggest, using pruneBefore solves my problem. I can turn off note content and get a reasonably fast response where is easy to see which have changed and which have not. Means my local last change date won't be accurate if all that has changed is the note title but I guess end users won't be too worried about that. Probably only important if we have a sync clash. I will follow up on the other sub issues discussed as I get some free time. Thanks for your advice. Davo |
closing in favor of #627 |
Hi folks, love your work.
I have a beta (and only just beta) sync working with tomboy-ng ( https://github.com/tomboy-notes/tomboy-ng ) and I have found that when a note is renamed in nextCloud, its modified time (as returned under the sync api) is not updated. This means that the remote system is unaware of a change to the note and does not choose to download it.
Reproducing this bug will depend very much on how you personally choose to tickle the api ....
Davo
The text was updated successfully, but these errors were encountered: