[fenix] Closes https://github.com/mozilla-mobile/fenix/issues/20901: Do not record...
commit51ed133aa548aefb8d2b3dc2bd1bad256150a667
authorGrisha Kruglov <gkruglov@mozilla.com>
Thu, 19 Aug 2021 02:49:05 +0000 (18 19:49 -0700)
committerGrisha Kruglov <grigory@kruglov.ca>
Thu, 19 Aug 2021 20:30:32 +0000 (19 13:30 -0700)
treebfc7b6f540482c4e55e7246de57f6866f41858c3
parent9050483293f7f8d034c12fa1bf325faf12b6595a
[fenix] Closes https://github.com/mozilla-mobile/fenix/issues/20901: Do not record viewTime observations when we do not have a set lastAccess

The bug here was that we'd try to record `now - 0` as a viewTime delta.
This isn't just an obviously wrong value to record, but it will also
overflow our storage - we'll end up with a value on disk that doesn't
fit into an i32, but HistoryMetadata.total_view_time is i32 in our Rust
struct. Once that happens, reads that touch this bad row will result in
an overflow and a crash.
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/historymetadata/HistoryMetadataService.kt