fix(android): stop dataSync foreground service crash loop - #22
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
dataSyncforeground service 配额耗尽时,在onTimeout()中立即stopSelf()。START_STICKY改为START_NOT_STICKY,避免重建无法恢复 JS/device connection 的空服务,以及额度耗尽后的二次启动异常。0.0.12:package/App version、Android versionCode、iOS buildNumber、CHANGELOG 和验证脚本已同步。根因
Android 16 / targetSdk 36 的现场日志显示:
dataSyncFGS 达到 Android 15+ 同类型滚动 24 小时内 6 小时后台预算;Service.onTimeout(int, int),触发ForegroundServiceDidNotStopInTimeException;START_STICKY在额度仍耗尽时尝试重建服务,又触发ForegroundServiceStartNotAllowedException。服务本身只显示可见通知、辅助提高进程优先级,不承载 JS runtime、WebSocket 或命令执行,因此 sticky 重建不能恢复连接。
能力、权限与平台差异
FOREGROUND_SERVICE与FOREGROUND_SERVICE_DATA_SYNC。验证证据
本地锁定 Node
22.23.1、pnpm11.21.0、Java 17:pnpm install --frozen-lockfile:通过pnpm verify:release-tag v0.0.12:通过pnpm verify:通过,79 suites / 367 testspnpm verify:doctor:21/21 checks 通过pnpm peers check:通过pnpm audit:dependencies:无 high/critical;1 个 moderatepnpm build:android:preview:通过ai.tokenroll.toolbridgemobile.preview0.0.12 / 12assets/index.android.bundlef2d2e14cec2dbf6261e332666fcc8a79304e913de2018a14bc94c741d3011826llmdoc validate:通过,仅有既存文档行数 warning未验证:
Tag 与发布
合并到
main且 mainverify成功后,auto-release-preview会从 package version 创建 annotatedv0.0.12,复用 verified APK artifact 并发布 GitHub Pre-release。tag 不在 PR 分支提前创建,也不会移动已有 tag。回滚
v0.0.12tag。v0.0.12已发布后需要代码回滚,应以新的 patch version 重新走 verify/tag/Preview 流程。