Skip to content

bug: Background-Runner script is not replaced properly on update, causing it to stop forever #643

Closed

Description

@louis123562

Bug Report

Capacitor Version

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 7.4.4
  @capacitor/core: 7.4.4
  @capacitor/android: 7.4.4
  @capacitor/ios: 7.4.4

Installed Dependencies:

  @capacitor/core: 7.4.4
  @capacitor/android: 7.4.4
  @capacitor/cli: 7.4.4
  @capacitor/ios: 7.4.4

[success] iOS looking great! 👌
[success] Android looking great! 👌

Plugin Version

▲   💊   Capgo Doctor  💊
│
●   App Name: planzeit App
│
●   App ID: planzeit.App
│
●   App Version: 
│
●   Web Dir: www
│
●   OS: darwin Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041
│
●   Node: v24.11.0
│
●   Installed Dependencies:
│
●     @capgo/cli: 7.20.1
│
●     @capawesome/capacitor-android-edge-to-edge-support: 7.2.3
│
●     @capawesome/capacitor-app-review: 7.0.1
│
●     @capgo/capacitor-navigation-bar: 7.3.11
│
●     @capgo/capacitor-updater: 7.25.1
│
●     capacitor-lottie-splash-screen: 7.2.2
│
●     capacitor-native-settings: 7.0.2
│
◇  Latest Dependencies:
│
●     @capgo/cli: 7.20.1
│
●     @capawesome/capacitor-android-edge-to-edge-support: 7.2.3
│
●     @capawesome/capacitor-app-review: 7.0.1
│
●     @capgo/capacitor-navigation-bar: 7.3.11
│
●     @capgo/capacitor-updater: 7.27.3
│
●     capacitor-lottie-splash-screen: 7.2.2
│
●     capacitor-native-settings: 7.0.2
│
▲  🚨 Some dependencies are not up to date
Error: 
message: Some dependencies are not up to date
stack: 
  - Error: Some dependencies are not up to date
  -     at m2 (/Users/l.spieckerhoff/.npm/_npx/cbe5d2f7487966de/node_modules/@capgo/cli/dist/index.js:168:8606)
  -     at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
  -     at async t.<anonymous> (/Users/l.spieckerhoff/.npm/_npx/cbe5d2f7487966de/node_modules/@capgo/cli/dist/index.js:302:130)
  -     at async t.parseAsync (/Users/l.spieckerhoff/.npm/_npx/cbe5d2f7487966de/node_modules/@capgo/cli/dist/index.js:17:4207)

context(s)

ManualModel: true
AutoMode: false
CapgoCloud: false
OnPremise: true

Platform(s)

Android

Current Behavior

After updating a downloaded bundle, the capacitor background runner does not work anymore.
This causes the app to hang.
It would be interesting, how the replacement of single files is implemented.

We see a lot of A resource failed to call close. in the console.

Expected Behavior

The background runner should not be affected by the update.
I created a issue in their repo: ionic-team/capacitor-background-runner#136

Code Reproduction

Other Technical Details

npm --version output: 11.6.1

node --version output: v24.11.0

pod --version output (iOS issues only):

Additional Context

Activity

  1. TorichanCapgo commented on Feb 16, 2026

    @TorichanCapgo
    Contributor

    Thanks for the super detailed report 🙌 (doctor outputs + linked upstream issue are gold).\n\nTo help us reproduce quickly, could you share 3 extra details?\n1) Does it still happen on ?\n2) Is located inside your web bundle output () or copied from elsewhere at build time?\n3) After update, can you compare file size + hash of the runner script before/after (or confirm if file timestamp changes)?\n\nQuick guidance meanwhile: if this blocks production, pinning updates to bundles generated with the exact same Background Runner version/config is the safest temporary workaround.\n\nIf you can share a tiny repro repo (even private invite), I can test replacement flow end-to-end and suggest a patch path.

  2. TorichanCapgo commented on Feb 16, 2026

    @TorichanCapgo
    Contributor

    Tiny correction to my previous comment (formatting ate a few values):\n- version to test: @capgo/capacitor-updater@7.27.3\n- file to verify: background-runner.js\n- expected location: your app web output folder (usually www/)\n\nSorry for the formatting glitch 🙏

  3. TorichanCapgo commented on Feb 17, 2026

    @TorichanCapgo
    Contributor

    Thanks for reporting this — this one can definitely hurt reliability in production, so great catch.

    To de-risk a fix, could you share a quick repro matrix?

    • Capacitor Updater version + Capacitor version
    • Android version/device where it reproduces
    • Whether issue happens only after OTA update or also on clean install
    • Current capacitor.config updater options (especially autoUpdate, directUpdate, and backgroundRunner usage)
    • A short logcat excerpt around app start + updater apply phase

    Likely fix direction (low-risk): validate/copy background-runner assets with checksum + fallback restore before marking update as active. If you confirm the matrix above, we can pin down whether this is timing, path resolution, or asset persistence.

  4. added a commit that references this issue on Aug 18, 2026
    192ed9c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions