fix: let prerelease builds follow their own channel

Merged
TH
2mo ago
+105-9

Summary

Prepares prerelease builds for the nightly channel in #3380:

  • Update notice: a -nightly. build checks and recommends agent-device@nightly, not @latest. The update-check cache records which dist-tag it read from, so a version cached from the other channel is never shown. After a channel switch the next command runs a fresh check, and a failed check still records the new channel.
  • Android helper versionCode: a prerelease helper takes its base release's versionCode instead of 1, so a nightly or -dev helper replaces an older release. An equal code reinstalls when the checksums differ.

3 files.

Validation

At cdf4e654b7:

  • src/__tests__/update-check.test.ts: 8/8 pass, including the channel-switch and failed-check cases.
  • Live Android run on an API 37 emulator (evidence):
    • The published 0.21.24 helper was outdated and got replaced; the device then reported versionCode=21025.
    • The next run reported current and did not reinstall.
    • A nightly helper with the same code reinstalled once (mismatched), then reported current.