Skip to content

Tombstone: fall back to file timestamp on empty pb timestamp - #737

Open
besendorf wants to merge 4 commits into
mainfrom
fix_tombstone
Open

Tombstone: fall back to file timestamp on empty pb timestamp#737
besendorf wants to merge 4 commits into
mainfrom
fix_tombstone

Conversation

@besendorf

Copy link
Copy Markdown
Collaborator
  • Allow empty protobuf timestamps to fall back to the file timestamp
  • Update _parse_timestamp_string to accept a fallback
  • Pass file_timestamp to its callers
  • Add tests for empty and whitespace tombstone timestamps
  • Adjust imports in bugreport module to include DumpsysADBState Tombstone: use file timestamp on empty pb
  • skip 0 bytes tombstones and show debug warning

- Allow empty protobuf timestamps to fall back to the file timestamp
- Update _parse_timestamp_string to accept a fallback
- Pass file_timestamp to its callers
- Add tests for empty and whitespace tombstone timestamps
- Adjust imports in bugreport module to include DumpsysADBState
  Tombstone: use file timestamp on empty pb
- skip 0 bytes tombstones and show debug warning
@github-actions

github-actions Bot commented Jan 20, 2026

Copy link
Copy Markdown
Contributor

Coverage

Tests Skipped Failures Errors Time
113 1 💤 0 ❌ 0 🔥 9.787s ⏱️

@bitmeta69

Copy link
Copy Markdown

Thanks for working on this. I independently confirmed the zero-byte case against the released MVT v2026.7.29. A consented Android 13 bugreport contained 25 zero-byte FS/data/tombstones/tombstone_*.pb placeholder entries, and the Tombstones module emitted 25 String does not contain a date errors.

The failure also reproduces without device data:

from datetime import datetime, timezone
from mvt.android.modules.bugreport.tombstones import Tombstones

Tombstones().parse_protobuf(
    "tombstone_00.pb",
    datetime(2026, 1, 1, tzinfo=timezone.utc),
    b"",
)

This raises ParserError: String does not contain a date:. The early zero-length check in this PR appears to address the exact observed case. I can validate a rebased revision against the preserved acquisition if that would be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants