scripts/gen_i18n.py calls emit_frontend_types_for_modules and then unconditionally prints
"i18n key files regenerated" (scripts/gen_i18n.py:22-23). That function swallows every failure by
design — "stale types are preferable to a broken boot" — logging it and returning normally
(framework/hosting/simple_module_hosting/i18n_manifest.py:83-94). The script also never configures
logging, so the logger.info("Wrote %s (%d keys)", …) lines that would say what actually happened
(i18n_manifest.py:122, :126) are below the default threshold and never appear.
The result is a tool that reports success identically whether it regenerated the key files or failed
to write any of them, with no output to distinguish the two. The next symptom is a tsc error about
a key that exists in the catalog, several steps removed from the cause.
What would fix it: add logging.basicConfig(level=logging.INFO) to the script so the per-file lines
are visible, and have the script report the real outcome — either by having
emit_frontend_types_for_modules return what it wrote, or by giving it a strict flag that re-raises
for callers (this script, make gen-i18n) that are not a live boot and should fail loudly.
Two stale comments in the same area, from when generate_verification_token was collapsed into
UserManager.mint_invite_token (modules/users/users/manager.py:171) — neither name resolves to
anything in this tree or in fastapi-users:
scripts/gen_i18n.pycallsemit_frontend_types_for_modulesand then unconditionally prints"i18n key files regenerated"(scripts/gen_i18n.py:22-23). That function swallows every failure bydesign — "stale types are preferable to a broken boot" — logging it and returning normally
(
framework/hosting/simple_module_hosting/i18n_manifest.py:83-94). The script also never configureslogging, so the
logger.info("Wrote %s (%d keys)", …)lines that would say what actually happened(
i18n_manifest.py:122,:126) are below the default threshold and never appear.The result is a tool that reports success identically whether it regenerated the key files or failed
to write any of them, with no output to distinguish the two. The next symptom is a
tscerror abouta key that exists in the catalog, several steps removed from the cause.
What would fix it: add
logging.basicConfig(level=logging.INFO)to the script so the per-file linesare visible, and have the script report the real outcome — either by having
emit_frontend_types_for_modulesreturn what it wrote, or by giving it astrictflag that re-raisesfor callers (this script,
make gen-i18n) that are not a live boot and should fail loudly.Two stale comments in the same area, from when
generate_verification_tokenwas collapsed intoUserManager.mint_invite_token(modules/users/users/manager.py:171) — neither name resolves toanything in this tree or in fastapi-users:
tests/e2e/conftest.py:88— "The token shape mirrors whatUserManager.generate_verification_tokenproduces".modules/users/tests/test_user_manager.py:178— the section banner# generate_verification_tokenaboveclass TestMintInviteToken.