Imported boards change ID
Closed this issue · 6 comments
Expected behaviour: Import/Export behaves like Save/Load in a desktop software. (To facilitate data preservation after cache clearing, and the sharing of boards between users/browsers.)
Problem: Saving a board by exporting it works as expected. However, reimporting doesn't replace the original board but opens up a new board with a different internal ID. Result: two boards with the same name but possibly differing contents in the board list, one of which then has to be deleted manually.
Requested solution: Importing a board preserves the internal ID (-> change importBoard
). If there is already a board with this ID open, replace it after asking for confirmation from the user.
That's by design actually, to allow cloning a board.
I am not particularly attached to this though. What's the use-case exactly? Are you using export-import cycle to move a board between two browsers, repeatedly? My original intent from export/import was to be a backup/restore facility, i.e. something that's used only once in a while.
to allow cloning a board
Ah, that was the idea ... I was wondering 😁
Basically, I like to work with actual files. Having my data in the browser cache is neat because it's persistent across sessions, but I also want to know where that data is on my hard drive. Specifically, I don't want to have to worry about forgetting to back up my boards before I clear my cache, so I want to save them regularly in a place I know.
Also, files are much more versatile than a blob in localStorage
. I can back them up externally, I can host them on my cloud, I can send them to other people... Plus, I can edit them with other tools, if I ever need/want to. (Actually, I discovered this issue when I had to hand-edit one of my boards with Emacs when transferring lists between boards.)
In short, I think the export/import feature is fantastic and offers a lot of use cases. (Especially as it exports to a standard text format.)
However, I can also see the value in being able to clone a board. Would it perhaps be an option to ask the user, on importing a board with a pre-existing ID, whether he wants to overwrite or clone the current board?
We try to keep files out of LocalStore
to use cleaner programs (e.g. CC Cleaner). Also, we would like to have different nullboards
and put them in directories on Google Drive. Would like folks with access to the Drive directory to be able to read/write the specific nullboard
. Ideally, folks could bookmark the target nullboard
. Alternatively, they would use import
to open, read, write the target nullboard
@veddox @davhe see #62 (982e26384f), in here:
which does exactly as proposed: there would be an confirmation dialog asking whether do you want to generate a new board id. Choosing "Cancel" will overwrite the board instead.
I would agree that this isn't very user oriented, but I needed this as well, and I was short on time )
OK, so this should now be resolved with a456a76.
The logic now is as follows -
- If there's no ID conflict, the imported board keeps its ID
- If there's a conflict, NB will prompt if to overwrite the existing board.
- If the answer is no, it will ask if to assign it a new ID and then import.