I read many PDFs everyday, since the firs day i use Okular this error never happened, but yesterday when i read PDF book, let's say free_as_in_freedom-2.0.pdf, the 2388364.free_as_in_freedom-2.0.pdf become 0 byte, before i have read more than 200 pages and give a comments and anotation to many pages. so it's really make me sad. - but fortunately, i always backup montly the ~/okular/docdata files. // i think ( maybe) it's because my laptop runs out of battery, so when it start to boot after runs out of battery, the systemd clearing all cache. Reproducible: Didn't try Steps to Reproduce: 1.open the free_as_in_freedom-2.0.pdf 2.force shutdown ( make your laptop battery running out) 3. boot Actual Results: the file 2388364.free_as_in_freedom-2.0.pdf.xml become 0 byte Expected Results: the file 2388364.free_as_in_freedom-2.0.pdf.xml stay at 20 mb or above - i think it's because when booting after laptops running out the batree, systemd boot with clearing cache ( maybe). - the affected files ( .xml ) just for opened PDF at the time before laptops running out the batree, other .xml are safe.
Okular does not use docdata for annotations anymore, so this part of the issue is fixed. The remaining data in the docdata files are just the viewport, so if the docdata is broken you only need to scroll back to your current page. If I kill Okular with Ctrl+Alt+Esc, that doesn’t break the docdata file of the open document.