Repository navigation
refactor: check in other authorities' lexicons instead of fetching them at run time - #241
Merged
Merged
Conversation
…ent lexicons, with a pull to refresh them The web app and locallibrary resolved these from lexicon.community's PDS at run time. Checked-in copies, recorded with their authority DID and CID in lexicons/README.md, let both load them without a network read. tools/lexicons.sh pull re-fetches every lexicon outside computer/, and lint and breaking now cover only ours.
…d of resolving them at startup Startup read the calendar event and location lexicons from lexicon.community's PDS through LexResolver. They now come from the checked-in copies, the hand-written test stand-ins go, and tests validate against the real documents. @atproto/lex-resolver is no longer a dependency of the app.
…tead of fetching it Publishing a set with a location fetched community.lexicon.location.address from its authority's PDS. The checked-in copy is embedded instead, which removes the DNS lookup, the fetch, the $LOCALLIBRARY_LEXICONS override and the hickory-resolver dependency.
# Conflicts: # apps/web/package.json # apps/web/src/lib/server/app.ts # pnpm-lock.yaml
# Conflicts: # crates/locallibrary/Cargo.toml
Coverage Report for apps/web
File Coverage
SizeCompared with main. KiB are 1,024 bytes.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Coverage Report for apps/localtoolbox
File CoverageNo changed files found.SizeCompared with main. KiB are 1,024 bytes.
|
Rust coverageFrom run 460. Both are held to the thresholds in .cargo/config.toml.
|
# Conflicts: # apps/locallibrary/tests/it/main.rs
bnb
previously approved these changes
Oct 25, 2026
bnb
approved these changes
Oct 25, 2026
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.
What and why
The website and locallibrary read other authorities' lexicons from their PDS while running. The website resolved
community.lexicon.calendar.eventand the location lexicons throughLexResolverat startup (lexicons.ts#L132), and locallibrary fetchedcommunity.lexicon.location.addresswhenever it published a set with a location (mod.rs#L308-L349). Both now use copies checked in underlexicons/community/, and HappyView's bundle uploads the same copy.Added:
lexicons/community/lexicon/location/{address,geo,fsq,hthree}.jsonandlexicons/community/lexicon/calendar/event.json, exactly as lexicon.community publishes themlexicons/README.md: which folders are ours, where each copy came from (authority DID and record CID), and how to refresh themtools/lexicons.sh pull, which re-fetches every lexicon outsidelexicons/computer/Changed:
tools/lexicons.sh lintandbreakingonly coverlexicons/computer/strongRef,discussionandspacecopies are re-pulled in goat's formatting (same content), sopullis idempotentRemoved:
@atproto/lex-resolverfetch_lexicon, the$LOCALLIBRARY_LEXICONSoverride, the ref-depth guard only fetched documents needed, andhickory-resolverHow it was tested
pnpm verifyandpnpm test:coverage, with new tests that every referenced NSID is checked in and that a set's address validates against the real lexiconcargo coverage, and the Hegel coverage runtools/lexicons.sh lintandbreaking,tools/policy.shChecklist
apps/locallibrary/CHANGELOG.mdhas a line under Unreleased, if people using it will noticedocs/and--helpstill say what the code does