Skip to content

deferredUpdatesDistanceを0にして停車中もバックグラウンド更新が届くようにする#5420

Merged
TinyKitten merged 3 commits intodevfrom
claude/fix-android-location-updates-dpnFS
Feb 22, 2026
Merged

deferredUpdatesDistanceを0にして停車中もバックグラウンド更新が届くようにする#5420
TinyKitten merged 3 commits intodevfrom
claude/fix-android-location-updates-dpnFS

Conversation

@TinyKitten
Copy link
Member

@TinyKitten TinyKitten commented Feb 22, 2026

Summary by CodeRabbit

リリースノート

  • 改善
    • 位置情報更新の間隔を調整し、背景位置情報更新の動作を最適化しました。

expo-task-managerはバックグラウンドでJobScheduler経由でJS側にデータを配信するため、
deferredUpdatesを0にすると毎回の位置更新ごとにジョブがスケジュールされ、
Android 16で新たにフォアグラウンドサービス動作中にも適用されるようになった
クォータを超過してバックグラウンド更新が停止していた。

https://claude.ai/code/session_017LJ3KNDwwVChQJbm9qgvHB
shouldReportDeferredLocationsはinterval AND distanceの両方を要求するため、
distance > 0だと停車中に条件を満たせずJS側に位置情報が配信されない。
intervalのみでJobSchedulerジョブの発火頻度を制御する。

https://claude.ai/code/session_017LJ3KNDwwVChQJbm9qgvHB
@github-actions github-actions bot added the react label Feb 22, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 22, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

ウォークスルー

ロケーション定数が修正されました。LOCATION_TIME_INTERVAL が 1000 から 3000 ミリ秒に変更され、deferredUpdatesInterval がこの定数を参照するように更新されました。Android のバックグラウンドロケーション動作に関する説明的なコメントが追加されました。

変更内容

コホート / ファイル 概要
ロケーション定数の調整
src/constants/location.ts
LOCATION_TIME_INTERVAL を 1000 から 3000 に変更し、LOCATION_TASK_OPTIONS の deferredUpdatesInterval をこの定数に紐付けました。動作と制約に関するコメントが追加されました。
ドキュメンテーション更新
src/hooks/useStartBackgroundLocationUpdates.ts
Android のバックグラウンドロケーション更新に関する説明的なコメントが更新されました。ロジックの変更はありません。

推定レビュー時間

🎯 2 (Simple) | ⏱️ ~8 分

関連する可能性のあるPR

推奨ラベル

android

ポエム

🐰 ロケーション更新のリズムを整えて
三秒のスケジュール、新しく踊る
定数は繋がり、動作は滑らか
Android の背景でも、精密に
ウサギが祝う、時間の調和 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning PRのタイトルは日本語で「deferredUpdatesDistanceを0にして停車中もバックグラウンド更新が届くようにする」ですが、実際の変更は LOCATION_TIME_INTERVAL を1000から3000に変更し、deferredUpdatesInterval を0から LOCATION_TIME_INTERVAL に変更しています。タイトルで言及されている「deferredUpdatesDistance」の変更は実際のコード変更に含まれていません。 タイトルを実際の変更内容に合わせて更新してください。例えば「LOCATION_TIME_INTERVALを3000に変更し、deferredUpdatesIntervalを連動させる」などが適切です。
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/fix-android-location-updates-dpnFS

Comment @coderabbitai help to get the list of available commands and usage tips.

@TinyKitten TinyKitten merged commit 8d96e61 into dev Feb 22, 2026
7 checks passed
@TinyKitten TinyKitten deleted the claude/fix-android-location-updates-dpnFS branch February 22, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants