Commit 7db606b
fix(export): don't serve stale PDF fonts after a font file changes
Review feedback on #8249.
`readFontFile()` cached both font buffers and read failures forever,
keyed only by path. An operator who corrected a wrong `exportPdfFonts`
path, or replaced a face in place, kept getting the old bytes — or the
fallback — until Etherpad was restarted.
The cache now keys on the file's mtime and size as well as its path, and
failures are not cached at all, so a font that appears or changes at a
configured path is picked up by the next export. One `stat` per font
variant per export.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013S4pYSjwUsiZtdtMMpW7bw1 parent bc6bff4 commit 7db606b
2 files changed
Lines changed: 57 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
232 | 236 | | |
233 | 237 | | |
234 | | - | |
235 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
236 | 250 | | |
237 | 251 | | |
238 | 252 | | |
239 | 253 | | |
240 | | - | |
| 254 | + | |
| 255 | + | |
241 | 256 | | |
242 | | - | |
| 257 | + | |
243 | 258 | | |
244 | 259 | | |
245 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
820 | 857 | | |
821 | 858 | | |
822 | 859 | | |
| |||
0 commit comments