expo-task-manager 58.0.13 → 58.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/taskmanager/TaskService.java +14 -1
  4. package/build/TaskManager.js +6 -4
  5. package/build/TaskManager.js.map +1 -1
  6. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/{58.0.13/expo.modules.taskmanager-58.0.13-sources.jar → 58.0.14/expo.modules.taskmanager-58.0.14-sources.jar} +0 -0
  7. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.14/expo.modules.taskmanager-58.0.14-sources.jar.md5 +1 -0
  8. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.14/expo.modules.taskmanager-58.0.14-sources.jar.sha1 +1 -0
  9. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.14/expo.modules.taskmanager-58.0.14-sources.jar.sha256 +1 -0
  10. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.14/expo.modules.taskmanager-58.0.14-sources.jar.sha512 +1 -0
  11. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.14/expo.modules.taskmanager-58.0.14.aar +0 -0
  12. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.14/expo.modules.taskmanager-58.0.14.aar.md5 +1 -0
  13. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.14/expo.modules.taskmanager-58.0.14.aar.sha1 +1 -0
  14. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.14/expo.modules.taskmanager-58.0.14.aar.sha256 +1 -0
  15. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.14/expo.modules.taskmanager-58.0.14.aar.sha512 +1 -0
  16. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/{58.0.13/expo.modules.taskmanager-58.0.13.module → 58.0.14/expo.modules.taskmanager-58.0.14.module} +22 -22
  17. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.14/expo.modules.taskmanager-58.0.14.module.md5 +1 -0
  18. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.14/expo.modules.taskmanager-58.0.14.module.sha1 +1 -0
  19. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.14/expo.modules.taskmanager-58.0.14.module.sha256 +1 -0
  20. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.14/expo.modules.taskmanager-58.0.14.module.sha512 +1 -0
  21. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/{58.0.13/expo.modules.taskmanager-58.0.13.pom → 58.0.14/expo.modules.taskmanager-58.0.14.pom} +1 -1
  22. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.14/expo.modules.taskmanager-58.0.14.pom.md5 +1 -0
  23. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.14/expo.modules.taskmanager-58.0.14.pom.sha1 +1 -0
  24. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.14/expo.modules.taskmanager-58.0.14.pom.sha256 +1 -0
  25. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.14/expo.modules.taskmanager-58.0.14.pom.sha512 +1 -0
  26. package/package.json +3 -3
  27. package/src/TaskManager.ts +6 -4
  28. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.13/expo.modules.taskmanager-58.0.13-sources.jar.md5 +0 -1
  29. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.13/expo.modules.taskmanager-58.0.13-sources.jar.sha1 +0 -1
  30. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.13/expo.modules.taskmanager-58.0.13-sources.jar.sha256 +0 -1
  31. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.13/expo.modules.taskmanager-58.0.13-sources.jar.sha512 +0 -1
  32. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.13/expo.modules.taskmanager-58.0.13.aar +0 -0
  33. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.13/expo.modules.taskmanager-58.0.13.aar.md5 +0 -1
  34. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.13/expo.modules.taskmanager-58.0.13.aar.sha1 +0 -1
  35. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.13/expo.modules.taskmanager-58.0.13.aar.sha256 +0 -1
  36. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.13/expo.modules.taskmanager-58.0.13.aar.sha512 +0 -1
  37. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.13/expo.modules.taskmanager-58.0.13.module.md5 +0 -1
  38. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.13/expo.modules.taskmanager-58.0.13.module.sha1 +0 -1
  39. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.13/expo.modules.taskmanager-58.0.13.module.sha256 +0 -1
  40. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.13/expo.modules.taskmanager-58.0.13.module.sha512 +0 -1
  41. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.13/expo.modules.taskmanager-58.0.13.pom.md5 +0 -1
  42. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.13/expo.modules.taskmanager-58.0.13.pom.sha1 +0 -1
  43. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.13/expo.modules.taskmanager-58.0.13.pom.sha256 +0 -1
  44. package/local-maven-repo/host/exp/exponent/expo.modules.taskmanager/58.0.13/expo.modules.taskmanager-58.0.13.pom.sha512 +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 58.0.14
4
+
5
+ ### Patch Changes
6
+
7
+ - [Android] Fix JS timers, and anything built on them such as `fetch()`, hanging in background tasks on React Native 0.86 and later. The headless task that keeps timers alive no longer finishes as soon as it starts. ([#53102](https://github.com/expo/expo/pull/53102) by [@chrfalch](https://github.com/chrfalch))
8
+
3
9
  ## 58.0.13
4
10
 
5
11
  ### Patch Changes
@@ -4,13 +4,13 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'host.exp.exponent'
7
- version = '58.0.13'
7
+ version = '58.0.14'
8
8
 
9
9
  android {
10
10
  namespace "expo.modules.taskmanager"
11
11
  defaultConfig {
12
12
  versionCode 23
13
- versionName "58.0.13"
13
+ versionName "58.0.14"
14
14
  consumerProguardFiles 'proguard-rules.pro'
15
15
  }
16
16
  }
@@ -58,6 +58,9 @@ public class TaskService implements SingletonModule, TaskServiceInterface {
58
58
  private static final String TAG = "TaskService";
59
59
  private static final String SHARED_PREFERENCES_NAME = "TaskManagerModule";
60
60
  private static final int MAX_TASK_EXECUTION_TIME_MS = 15000; // 15 seconds
61
+ // Upper bound for the headless task that keeps JS timers alive, in case no finish path runs.
62
+ // Matches the 10 minutes JobScheduler gives a job.
63
+ private static final long HEADLESS_TASK_TIMEOUT_MS = 10 * 60 * 1000;
61
64
 
62
65
  private WeakReference<Context> mContextRef;
63
66
  private TaskManagerUtilsInterface mTaskManagerUtils;
@@ -431,6 +434,7 @@ public class TaskService implements SingletonModule, TaskServiceInterface {
431
434
  success -> {
432
435
  if (!success) {
433
436
  sEvents.remove(appScopeKey);
437
+ maybeFinishHeadlessTask(appScopeKey);
434
438
  mTasksAndEventsRepository.removeEvents(appScopeKey);
435
439
 
436
440
  // Host unreachable? Unregister all tasks for that app.
@@ -651,11 +655,20 @@ public class TaskService implements SingletonModule, TaskServiceInterface {
651
655
  HeadlessJsTaskConfig taskConfig = new HeadlessJsTaskConfig(
652
656
  "expo-task-manager",
653
657
  new WritableNativeMap(),
654
- 0, // no timeout, managed by the task consumer
658
+ HEADLESS_TASK_TIMEOUT_MS, // finished by maybeFinishHeadlessTask, the timeout is a safety net
655
659
  true // allow in foreground to avoid exceptions if app returns
656
660
  );
657
661
 
658
662
  UiThreadUtil.runOnUiThread(() -> {
663
+ // The events may be done already, e.g. when the cold-start listener fires late.
664
+ if (!sEvents.containsKey(appScopeKey)) {
665
+ return;
666
+ }
667
+ // Don't replace a keepalive that is still running, its ID would never be finished.
668
+ Integer runningTaskId = sHeadlessTaskIds.get(appScopeKey);
669
+ if (runningTaskId != null && headlessContext.isTaskRunning(runningTaskId)) {
670
+ return;
671
+ }
659
672
  try {
660
673
  int taskId = headlessContext.startTask(taskConfig);
661
674
  sHeadlessTaskIds.put(appScopeKey, taskId);
@@ -2,11 +2,13 @@ import { Platform, UnavailabilityError } from 'expo';
2
2
  import { LegacyEventEmitter } from 'expo-modules-core';
3
3
  import { AppRegistry } from 'react-native';
4
4
  import ExpoTaskManager from './ExpoTaskManager';
5
- // Register a no-op headless task so that HeadlessJsTaskContext.startTask()
6
- // doesn't log a warning. On Android, TaskService registers a headless task
7
- // in native code to keep JS timers alive during background task execution.
5
+ // On Android, TaskService starts this headless task in native code to keep JS timers
6
+ // alive during background task execution, and finishes it natively once the task is done
7
+ // (or after a timeout).
8
+ // The JS side must never settle: a resolved promise makes AppRegistry call
9
+ // notifyTaskFinished, which ends the task right away and pauses timers again.
8
10
  if (Platform.OS === 'android') {
9
- AppRegistry.registerHeadlessTask('expo-task-manager', ()=>async ()=>{});
11
+ AppRegistry.registerHeadlessTask('expo-task-manager', ()=>()=>new Promise(()=>{}));
10
12
  }
11
13
  const tasks = new Map();
12
14
  function _validate(taskName) {
@@ -1 +1 @@
1
- {"version":3,"sources":["TaskManager.ts"],"sourcesContent":[null],"names":["Platform","UnavailabilityError","LegacyEventEmitter","AppRegistry","ExpoTaskManager","OS","registerHeadlessTask","tasks","Map","_validate","taskName","TypeError","hasFinishedInitPhase","Promise","resolve","then","defineTask","taskExecutor","console","warn","has","set","isTaskDefined","isTaskRegisteredAsync","getTaskOptionsAsync","getRegisteredTasksAsync","unregisterTaskAsync","unregisterAllTasksAsync","eventEmitter","addListener","EVENT_NAME","data","error","executionInfo","eventId","get","result","notifyTaskFinishedAsync","keys","join","isAvailableAsync"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,mBAAmB,QAAQ,OAAO;AACrD,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,SAASC,WAAW,QAAQ,eAAe;AAE3C,OAAOC,qBAAqB,oBAAoB;AAEhD,2EAA2E;AAC3E,2EAA2E;AAC3E,2EAA2E;AAC3E,IAAIJ,SAASK,EAAE,KAAK,WAAW;IAC7BF,YAAYG,oBAAoB,CAAC,qBAAqB,IAAM,WAAa;AAC3E;AA2FA,MAAMC,QAAmD,IAAIC;AAK7D,SAASC,UAAUC,QAAiB;IAClC,IAAI,CAACA,YAAY,OAAOA,aAAa,UAAU;QAC7C,MAAM,IAAIC,UAAU;IACtB;AACF;AAEA,8HAA8H;AAC9H,gBAAgB;AAChB,6EAA6E;AAC7E,qFAAqF;AACrF,gCAAgC;AAChC,oEAAoE;AACpE,IAAIC,uBAAuB;AAC3BC,QAAQC,OAAO,GAAGC,IAAI,CAAC;IACrBH,uBAAuB;AACzB;AAEA,cAAc;AACd;;;;;;;;CAQC,GACD,OAAO,SAASI,WACdN,QAAgB,EAChBO,YAAwC;IAExC,IAAI,CAACP,YAAY,OAAOA,aAAa,UAAU;QAC7CQ,QAAQC,IAAI,CAAC,CAAC,uEAAuE,CAAC;QACtF;IACF;IACA,IAAI,CAACF,gBAAgB,OAAOA,iBAAiB,YAAY;QACvDC,QAAQC,IAAI,CAAC,CAAC,2DAA2D,CAAC;QAC1E;IACF;IACA,IAAI,CAACZ,MAAMa,GAAG,CAACV,aAAaE,sBAAsB;QAChDM,QAAQC,IAAI,CACV,CAAC,kCAAkC,EAAET,SAAS;;kGAE8C,CAAC;IAEjG;IACAH,MAAMc,GAAG,CAACX,UAAUO;AACtB;AAEA,cAAc;AACd;;;;CAIC,GACD,OAAO,SAASK,cAAcZ,QAAgB;IAC5C,OAAOH,MAAMa,GAAG,CA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C9B,MAAMhB,eAAeV,MAAM4B,GAAG,CAACzB;QAC/B,IAAI0B,SAAc;QAElB,IAAInB,cAAc;YAChB,IAAI;gBACF,kBAAkB;gBAClBmB,SAAS,MAAMnB,aAAa;oBAAEc;oBAAMC;oBAAOC;gBAAc;YAC3D,EAAE,OAAOD,OAAO;gBACdd,QAAQc,KAAK,CAAC,CAAC,mBAAmB,EAAEtB,SAAS,SAAS,CAAC,EAAEsB;YAC3D,SAAU;gBACR,uCAAuC;gBACvC,MAAM5B,gBAAgBiC,uBAAuB,CAAC3B,UAAU;oBAAEwB;oBAASE;gBAAO;YAC5E;QACF,OAAO;YACLlB,QAAQC,IAAI,CACV,CAAC,2BAA2B,EAAET,SAAS,oEAAoE,EAAE;mBAAIH,MAAM+B,IAAI;aAAG,CAACC,IAAI,CAAC,MAAM,iFAAiF,CAAC;YAE9N,6DAA6D;YAC7D,MAAMnC,gBAAgBiC,uBAAuB,CAAC3B,UAAU;gBAAEwB;gBAASE;YAAO;YAC1E,yFAAyF;YACzF,mGAAmG;YACnG,MAAMhC,gBAAgBsB,mBAAmB,CAAChB;QAC5C;IACF;AAEJ;AAEA,cAAc;AACd;;;;;;CAMC,GACD,OAAO,eAAe8B;IACpB,OAAOpC,gBAAgBoC,gBAAgB;AACzC"}
1
+ {"version":3,"sources":["TaskManager.ts"],"sourcesContent":[null],"names":["Platform","UnavailabilityError","LegacyEventEmitter","AppRegistry","ExpoTaskManager","OS","registerHeadlessTask","Promise","tasks","Map","_validate","taskName","TypeError","hasFinishedInitPhase","resolve","then","defineTask","taskExecutor","console","warn","has","set","isTaskDefined","isTaskRegisteredAsync","getTaskOptionsAsync","getRegisteredTasksAsync","unregisterTaskAsync","unregisterAllTasksAsync","eventEmitter","addListener","EVENT_NAME","data","error","executionInfo","eventId","get","result","notifyTaskFinishedAsync","keys","join","isAvailableAsync"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,mBAAmB,QAAQ,OAAO;AACrD,SAASC,kBAAkB,QAAQ,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S,MAAMnB,aAAa;oBAAEc;oBAAMC;oBAAOC;gBAAc;YAC3D,EAAE,OAAOD,OAAO;gBACdd,QAAQc,KAAK,CAAC,CAAC,mBAAmB,EAAErB,SAAS,SAAS,CAAC,EAAEqB;YAC3D,SAAU;gBACR,uCAAuC;gBACvC,MAAM5B,gBAAgBiC,uBAAuB,CAAC1B,UAAU;oBAAEuB;oBAASE;gBAAO;YAC5E;QACF,OAAO;YACLlB,QAAQC,IAAI,CACV,CAAC,2BAA2B,EAAER,SAAS,oEAAoE,EAAE;mBAAIH,MAAM8B,IAAI;aAAG,CAACC,IAAI,CAAC,MAAM,iFAAiF,CAAC;YAE9N,6DAA6D;YAC7D,MAAMnC,gBAAgBiC,uBAAuB,CAAC1B,UAAU;gBAAEuB;gBAASE;YAAO;YAC1E,yFAAyF;YACzF,mGAAmG;YACnG,MAAMhC,gBAAgBsB,mBAAmB,CAACf;QAC5C;IACF;AAEJ;AAEA,cAAc;AACd;;;;;;CAMC,GACD,OAAO,eAAe6B;IACpB,OAAOpC,gBAAgBoC,gBAAgB;AACzC"}
@@ -0,0 +1 @@
1
+ 89270a10768d67b1ae98de65d07374f8b8ce6c3e224d2e584dad89b64e9a6a74
@@ -0,0 +1 @@
1
+ 04f0ba5ab232bca8d88cfab4312d0c316efba9374836637554f4bd6829007fffff8efe3da59996de38fa035944d9a02ef61e01abc14a0d78df850bc2cf153ac0
@@ -0,0 +1 @@
1
+ 266ab08471f1245941d00530dd7bc6597976baca4de25d682eba28513c1b06e2
@@ -0,0 +1 @@
1
+ aebe1f06117965d9785c36fbdd871c99147472bee032cfcb15840dae53d1e84bff5e8ccba7979df006a5581889e9456e6aecec4da5bf2b12e41d5fda3440c245
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "host.exp.exponent",
5
5
  "module": "expo.modules.taskmanager",
6
- "version": "58.0.13",
6
+ "version": "58.0.14",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -33,13 +33,13 @@
33
33
  ],
34
34
  "files": [
35
35
  {
36
- "name": "expo.modules.taskmanager-58.0.13.aar",
37
- "url": "expo.modules.taskmanager-58.0.13.aar",
38
- "size": 68859,
39
- "sha512": "499ed2525fd82bbeeb105b3578ec45107039bf3223e55e5af894177e82879ff76d5719ce94278ad743cdb5045f0f08c731e7f7863817a3fdf2f842ee067eba4f",
40
- "sha256": "7832adffe6649f512f1b1a375e7e7d1d6e148a30e0e3538b5604286d5cfb60af",
41
- "sha1": "e69afaf5ef970b3d5a0e2cb93d72ad15bfe1842b",
42
- "md5": "9e6b8c3a7a3a1f0d972cefea4a61c1b0"
36
+ "name": "expo.modules.taskmanager-58.0.14.aar",
37
+ "url": "expo.modules.taskmanager-58.0.14.aar",
38
+ "size": 69001,
39
+ "sha512": "aebe1f06117965d9785c36fbdd871c99147472bee032cfcb15840dae53d1e84bff5e8ccba7979df006a5581889e9456e6aecec4da5bf2b12e41d5fda3440c245",
40
+ "sha256": "266ab08471f1245941d00530dd7bc6597976baca4de25d682eba28513c1b06e2",
41
+ "sha1": "54af50071c389423d1bea5949119e95853509b25",
42
+ "md5": "06c5f48ad9f3928991828a5ec3060259"
43
43
  }
44
44
  ]
45
45
  },
@@ -90,13 +90,13 @@
90
90
  ],
91
91
  "files": [
92
92
  {
93
- "name": "expo.modules.taskmanager-58.0.13.aar",
94
- "url": "expo.modules.taskmanager-58.0.13.aar",
95
- "size": 68859,
96
- "sha512": "499ed2525fd82bbeeb105b3578ec45107039bf3223e55e5af894177e82879ff76d5719ce94278ad743cdb5045f0f08c731e7f7863817a3fdf2f842ee067eba4f",
97
- "sha256": "7832adffe6649f512f1b1a375e7e7d1d6e148a30e0e3538b5604286d5cfb60af",
98
- "sha1": "e69afaf5ef970b3d5a0e2cb93d72ad15bfe1842b",
99
- "md5": "9e6b8c3a7a3a1f0d972cefea4a61c1b0"
93
+ "name": "expo.modules.taskmanager-58.0.14.aar",
94
+ "url": "expo.modules.taskmanager-58.0.14.aar",
95
+ "size": 69001,
96
+ "sha512": "aebe1f06117965d9785c36fbdd871c99147472bee032cfcb15840dae53d1e84bff5e8ccba7979df006a5581889e9456e6aecec4da5bf2b12e41d5fda3440c245",
97
+ "sha256": "266ab08471f1245941d00530dd7bc6597976baca4de25d682eba28513c1b06e2",
98
+ "sha1": "54af50071c389423d1bea5949119e95853509b25",
99
+ "md5": "06c5f48ad9f3928991828a5ec3060259"
100
100
  }
101
101
  ]
102
102
  },
@@ -110,13 +110,13 @@
110
110
  },
111
111
  "files": [
112
112
  {
113
- "name": "expo.modules.taskmanager-58.0.13-sources.jar",
114
- "url": "expo.modules.taskmanager-58.0.13-sources.jar",
115
- "size": 23796,
116
- "sha512": "0132b3672ef39489eab4bc5d651ca92c511d7aeb065ae1b5300f020f964141d13601d9adaafa3242614fdcb411f914107e36eb9b9e468fa236da5270ad925fa8",
117
- "sha256": "a5c46ec79cd89787383465c4daa7ab46ebb696d911ce22fe89fdb71cf4ddc91e",
118
- "sha1": "cff53ba4584cd742caf011c4a9b02ddf54644d0a",
119
- "md5": "33bc62bbc5b1a2493b36252d0699dfad"
113
+ "name": "expo.modules.taskmanager-58.0.14-sources.jar",
114
+ "url": "expo.modules.taskmanager-58.0.14-sources.jar",
115
+ "size": 24038,
116
+ "sha512": "04f0ba5ab232bca8d88cfab4312d0c316efba9374836637554f4bd6829007fffff8efe3da59996de38fa035944d9a02ef61e01abc14a0d78df850bc2cf153ac0",
117
+ "sha256": "89270a10768d67b1ae98de65d07374f8b8ce6c3e224d2e584dad89b64e9a6a74",
118
+ "sha1": "a1184ddb854585c9a6536bf0a92413e5e4aca7b8",
119
+ "md5": "b327838a497f99a4e82dae175a08c87c"
120
120
  }
121
121
  ]
122
122
  }
@@ -0,0 +1 @@
1
+ 141825699e6615c542a768401c14a81eda6aa4feecb5f127d7b3e1e069795699
@@ -0,0 +1 @@
1
+ 9a4b8017aa057133b3f3067a12a62d66d7d9c630a1234de059b5259e1119dd33c48f54f907572295a7c84062885420d35c0a4f989aa6a93f8ec91f2e2a9e0c90
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>host.exp.exponent</groupId>
11
11
  <artifactId>expo.modules.taskmanager</artifactId>
12
- <version>58.0.13</version>
12
+ <version>58.0.14</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.taskmanager</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ 6aaccdcf6392b5214bddb7d15e91af504000564a56ff47f9b203715152fe589e
@@ -0,0 +1 @@
1
+ a9effbe96f166c1fb4daa922e34f73edb410668bb4640b7123b59db244f95aeb37aa4ccbe2557cc032db81713424e1ea122b817da7e73038313360da2afc53b3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-task-manager",
3
- "version": "58.0.13",
3
+ "version": "58.0.14",
4
4
  "description": "Expo module that provides support for tasks that can run in the background.",
5
5
  "keywords": [
6
6
  "background",
@@ -27,10 +27,10 @@
27
27
  "unimodules-app-loader": "~58.0.2"
28
28
  },
29
29
  "devDependencies": {
30
- "@expo/internal-scripts": "58.0.5",
30
+ "@expo/internal-scripts": "58.0.6",
31
31
  "@types/jest": "^30.0.0",
32
32
  "@types/node": "^22.14.0",
33
- "expo": "58.0.22"
33
+ "expo": "58.0.24"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "expo": "*",
@@ -4,11 +4,13 @@ import { AppRegistry } from 'react-native';
4
4
 
5
5
  import ExpoTaskManager from './ExpoTaskManager';
6
6
 
7
- // Register a no-op headless task so that HeadlessJsTaskContext.startTask()
8
- // doesn't log a warning. On Android, TaskService registers a headless task
9
- // in native code to keep JS timers alive during background task execution.
7
+ // On Android, TaskService starts this headless task in native code to keep JS timers
8
+ // alive during background task execution, and finishes it natively once the task is done
9
+ // (or after a timeout).
10
+ // The JS side must never settle: a resolved promise makes AppRegistry call
11
+ // notifyTaskFinished, which ends the task right away and pauses timers again.
10
12
  if (Platform.OS === 'android') {
11
- AppRegistry.registerHeadlessTask('expo-task-manager', () => async () => {});
13
+ AppRegistry.registerHeadlessTask('expo-task-manager', () => () => new Promise(() => {}));
12
14
  }
13
15
 
14
16
  // @needsAudit @docsMissing
@@ -1 +0,0 @@
1
- a5c46ec79cd89787383465c4daa7ab46ebb696d911ce22fe89fdb71cf4ddc91e
@@ -1 +0,0 @@
1
- 0132b3672ef39489eab4bc5d651ca92c511d7aeb065ae1b5300f020f964141d13601d9adaafa3242614fdcb411f914107e36eb9b9e468fa236da5270ad925fa8
@@ -1 +0,0 @@
1
- 7832adffe6649f512f1b1a375e7e7d1d6e148a30e0e3538b5604286d5cfb60af
@@ -1 +0,0 @@
1
- 499ed2525fd82bbeeb105b3578ec45107039bf3223e55e5af894177e82879ff76d5719ce94278ad743cdb5045f0f08c731e7f7863817a3fdf2f842ee067eba4f
@@ -1 +0,0 @@
1
- 3c0c67074eba6cc0d571674bf1688f05e84cd3d71c71f0727eeb704ec3dae719
@@ -1 +0,0 @@
1
- e8c797bb000e5f67b0bcb710bdf4f49fac6613ee77ec67bbec586b08d4d926afd9bae5242de1c7ca34902faac2bd76a186a75ea6dd8bcb46d77b19f355bae9d6
@@ -1 +0,0 @@
1
- 1388191affec5a0bc12dd858542476c4f9654300fa02895946b98654178cb641
@@ -1 +0,0 @@
1
- aa2e2ec123df8ce2c73618c8c4f0252a0176dd8e3cffde6844a56195d8c911cf59583f9613be322ff5c1ac58decffd1d64a46ff05803cd3e787df373ff3794ad