Data-integrity review: browser visit lost on watcher destroy, export overwrite without truncate, notify drops startOfDay minutes (+2)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 28/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 領域
- mobile, mobile-dev
調査の方向性
Start with watcher/WebWatcher.kt around onDestroy (410-417): flush the open session via sessionTracker.handleUrl(null, null) before writer.shutdown(), using a Robolectric ServiceController and recording writer to prove it. Then inspect fragments/WebUIFragment.kt writeExport (1070) for the "wt" truncation fix and sendText (167-168) for surrogate-safe chunking. workers/NotifyWorker.kt parseStartOfDayHour (134) needs a LocalTime; the extractor findings at WebWatcher.kt 98/136/140 need a device repro and a privacy decision before changing recording behavior.
索引モデルが issue の本文から書いたものです。
説明
Remaining findings from a data-integrity review of aw-android master (aa9cea0). I checked each one against the code. They are not fixed in #407 (DST day window) or #408 (sub-second browser durations), and none of them duplicates an open issue or PR.
1. The browser visit in progress is lost when the accessibility service is destroyed. Two reviewers found this independently. A visit is written only when the URL, browser or window changes. WebWatcher.onDestroy (watcher/WebWatcher.kt:410-417) shuts down writer without first calling sessionTracker.handleUrl(null, null). If the user turns the service off, or the system unbinds it while a page is open, that whole visit is dropped. There is no upper bound on how much is lost: reading one page for 40 minutes loses 40 minutes. Fix: in onDestroy, flush the open session before writer.shutdown(). A test needs a Robolectric ServiceController with a recording writer, because the defect is a missing call that a pure tracker test can't see. A process kill (battery optimisation, app update) loses the visit too. Fixing that would need periodic chunked writes, as MediaPlaybackSegments already does.
2. Saving an export over an existing file can leave the old file's tail behind. WebUIFragment.writeExport (fragments/WebUIFragment.kt:1070) opens the URI with openOutputStream(uri), which means mode "w". Some providers (MediaProvider/FUSE-backed Downloads) don't truncate on "w", so a shorter re-export to the same file ends up with stale bytes after the closing ]. The SAF mirror already uses "wt" for this reason (SyncInterface.kt:605). Fix: openOutputStream(uri, "wt").
3. NotifyWorker drops the minutes of startOfDay. parseStartOfDayHour (workers/NotifyWorker.kt:134) keeps only the hour, so "04:30" becomes 4, while the widget and webui use 04:30. Between 04:00 and 04:30, alerts already query the new day and fire against totals that don't match what the app shows. The fired-key date also changes 30 minutes early. Fix: carry a LocalTime through logicalDayDate, with the logicalDate/logicalDayWindow helpers from #407.
4. Text typed into the address bar may be recorded as page URLs in Chrome, Edge, Samsung Internet and Opera (needs a device repro; privacy). The extractors at watcher/WebWatcher.kt:98, :136 and :140 read url_bar from the event source without ignoreFocused. Brave and the detected Chromium forks pass ignoreFocused = true "to avoid recording typed text" (#307). If typing fires content-changed events whose source includes the focused bar, each partial query becomes a short visit with url="how t". The device test only covers Brave. This changes what gets recorded, so Erik should decide on it.
5. A blob export can split an emoji across a 256K bridge chunk (medium confidence). sendText (WebUIFragment.kt:167-168) slices by UTF-16 code units. A surrogate pair that straddles a chunk boundary is split, and the halves likely reach Java as U+FFFD. Fix: don't end a chunk on a high surrogate.
Checked and found no defect: the usage-stats import cursors, replay and dedupe (read back from the DB, so a kill just replays and merges), timestamp precision, MediaWatcher flushes, the SAF mirror cleanup, and the JSON parse/error paths.
- 主要言語
- Kotlin
- スター
- 289
- フォーク
- 67
- 平均マージ
- 8日 52分
- マージ済み PR(30日)
- 8
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ActivityWatch/aw-android のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ActivityWatch/aw-android#383 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Web watcher: add support for Brave (`com.brave.browser` missing from KNOWN_BROWSER_PACKAGES)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ActivityWatch/aw-android#306 · コメント 1 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
AuthSettingsActivity crashes on launch (InflateException: Material attributes under AppCompat theme)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
ActivityWatch/aw-android#210 · コメント 11 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
ActivityWatch/aw-android#405 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
ActivityWatch/aw-android#402 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
ActivityWatch/aw-android の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
krelltunez/dayGLANCE#2445 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
EANs strippenオープンgood first issue prio:P3
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
haritpanchal/WakeGuard#16 ·
-
PathSegmentTemplateMatcher accepts conflicting captures for repeated variable names対応中かも @Christiansada が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
modelcontextprotocol/kotlin-sdk#1217 ·
メンテナーはふだん 3 日以内に返信