README.bigbThen the first:fails as desired before any rendering takes place:Then the second:fails differently, incorrectly trying to render but failing:with an error at render time.
= Index
<asdf>
ourbigbook .
extract_ids: README.bigb
extract_ids: README.bigb finished in 45.4546590000391 ms
error:
README.bigb:3:2: cross reference to unknown id: "asdf"
ourbigbook .
extract_ids: README.bigb
extract_ids: README.bigb skipped by timestamp
render: README.bigb
error: README.bigb:3:2: cross reference to unknown id: "asdf" at render time
copy README.bigb -> out/html/_raw/README.bigb
render: README.bigb -> out/html/index.html finished in 51.55012200027704 ms
This is especially noticeable/confusing when you are converting a large number of files, and the second run will start converting a large number of files instead of failing early, until it eventually reaches the error when rendering the specific file.
The key code point is:We are only checking the DB for the paths converted, but then due to parse skipping we skip the paths and don't check them anymore.
async function check_db(sequelize, paths_converted, { transaction }) {
Instead, we should check the entire database.
The question then is: is there a way to do this efficiently with a query, without bringing the entire Refs database into memory, notably conisdering inflections?