Persist default author in docs database - #113
Open
anchpop wants to merge 1 commit into
Open
Conversation
anchpop
force-pushed
the
default-author-in-db
branch
from
July 20, 2026 20:12
897413c to
6f00e9a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Iroh-docs currently does not support persistence on the web. To support persistence on the web, some kind of abstraction layer will be needed to hide the differences between web and native targets. To simplify that abstraction layer, iroh-docs should minimize the diversity in the ways it stores data.
If the default author were stored in the docs database itself, instead of in a sidecar file, that would be one less thing for the aforementioned future abstraction layer to think about.
Solution
Move the default author into the docs database. For existing clients, a database migration will import the default-author file on first open.
Imo, this is also just a simpler design. For example, take a look at this code that can now be deleted:
Previously, the code had to be careful to manipulate the database and the author ID in the right order for crash-correctness. This type of thing is just easier to do in a transactional database.
Breaking Changes
This is a breaking change because DefaultAuthorStorage is removed and Engine::spawn no longer takes a default author storage argument.
Change checklist