Add JSON backend #12

Open
opened 2025-10-15 09:57:26 +00:00 by xenrox · 1 comment
Owner

This is not straightforward. Because of racing conditions the file could become corrupted. One solution could be locking the file. Another would be to introduce a daemon, which caches the file in memory. The latter would complicate the architecture and deployment though.

Explanation for the racing condition: When a bookmark is opened, I want to increase a counter which can be used for sorting. When executing two bibliodrina commands in quick succession, the first write to the file may not be done.

This is not straightforward. Because of racing conditions the file could become corrupted. One solution could be locking the file. Another would be to introduce a daemon, which caches the file in memory. The latter would complicate the architecture and deployment though. Explanation for the racing condition: When a bookmark is opened, I want to increase a counter which can be used for sorting. When executing two bibliodrina commands in quick succession, the first write to the file may not be done.
Author
Owner

For Firefox bibliodrina could establish a continuous connection with browser.runtime.connectNative() to fix the above and increase performance with a cache.
The problem would still remain though with qutebrowser and the cli commands.

For Firefox bibliodrina could establish a continuous connection with `browser.runtime.connectNative()` to fix the above and increase performance with a cache. The problem would still remain though with qutebrowser and the cli commands.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
xenrox/bibliodrina#12
No description provided.