linkding icon indicating copy to clipboard operation
linkding copied to clipboard

Have the 'new' form load existing URL

Open zoredache opened this issue 3 years ago • 3 comments

The current behavior of the 'add' form simply overwriting existing bookmarks is pretty annoying. This is particularly true when trying to use using the bookmarklet.

In my opinion it would be ideal to completely merge the new+edit forms. If the 'new' form gets passed an existing URL load all the current details, instead of just allowing a blind overwrite with a warning.

This PR is my attempt at some of the changes you might need to do that.

zoredache avatar Aug 14 '21 20:08 zoredache

This is an interesting idea, but it needs more work, and some more thought. I might get to this at some point.

sissbruecker avatar Mar 26 '22 09:03 sissbruecker

A wrinkle I just thought about - how would this work if, say someone was submitting a URL through a mobile app/shortcut or an API?

feoh avatar May 21 '22 05:05 feoh

how would this work if, say someone was submitting a URL through a mobile app/shortcut or an API?

Well it would depend on what we want to happen.

From the server side. I would assume any new URLS being added wouldn't need to change, and deletes URLs wouldn't need to change. Only updates to existing URLs would matter. In the case of duplicate URLS you could just accept the most recent change. Or if you avoid the possibility of accidentally replacing things, you could do something like only accept modification requests if they include the 'date_modified' value of the previous version in the post or something, so you only permitted to modify the record if the client proves it has retrieved the most recent version. If you use the second option your reject message could return the values for the URL in the database, and the new data, and let the client resolve the conflict and submit an updated request.

zoredache avatar May 24 '22 06:05 zoredache

Closing in favor of https://github.com/sissbruecker/linkding/pull/402

sissbruecker avatar Jan 20 '23 21:01 sissbruecker