appium-uiautomator2-driver 9.2.2 → 9.3.0

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 (64) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +0 -2295
  3. package/build/lib/commands/misc.d.ts +15 -1
  4. package/build/lib/commands/misc.d.ts.map +1 -1
  5. package/build/lib/commands/misc.js +16 -0
  6. package/build/lib/commands/misc.js.map +1 -1
  7. package/build/lib/driver.d.ts.map +1 -1
  8. package/build/lib/driver.js +6 -1
  9. package/build/lib/driver.js.map +1 -1
  10. package/lib/commands/misc.ts +21 -1
  11. package/lib/driver.ts +7 -0
  12. package/node_modules/appium-android-driver/CHANGELOG.md +37 -0
  13. package/node_modules/appium-android-driver/build/lib/commands/find.js +2 -2
  14. package/node_modules/appium-android-driver/build/lib/commands/find.js.map +1 -1
  15. package/node_modules/appium-android-driver/build/lib/commands/media-stream/constants.d.ts +3 -0
  16. package/node_modules/appium-android-driver/build/lib/commands/media-stream/constants.d.ts.map +1 -1
  17. package/node_modules/appium-android-driver/build/lib/commands/media-stream/constants.js +4 -0
  18. package/node_modules/appium-android-driver/build/lib/commands/media-stream/constants.js.map +1 -1
  19. package/node_modules/appium-android-driver/build/lib/commands/media-stream/exports.d.ts +10 -4
  20. package/node_modules/appium-android-driver/build/lib/commands/media-stream/exports.d.ts.map +1 -1
  21. package/node_modules/appium-android-driver/build/lib/commands/media-stream/exports.js +37 -17
  22. package/node_modules/appium-android-driver/build/lib/commands/media-stream/exports.js.map +1 -1
  23. package/node_modules/appium-android-driver/build/lib/commands/media-stream/stream.d.ts +32 -2
  24. package/node_modules/appium-android-driver/build/lib/commands/media-stream/stream.d.ts.map +1 -1
  25. package/node_modules/appium-android-driver/build/lib/commands/media-stream/stream.js +59 -40
  26. package/node_modules/appium-android-driver/build/lib/commands/media-stream/stream.js.map +1 -1
  27. package/node_modules/appium-android-driver/build/lib/driver.d.ts +1 -0
  28. package/node_modules/appium-android-driver/build/lib/driver.d.ts.map +1 -1
  29. package/node_modules/appium-android-driver/build/lib/driver.js +1 -0
  30. package/node_modules/appium-android-driver/build/lib/driver.js.map +1 -1
  31. package/node_modules/appium-android-driver/lib/commands/find.ts +2 -2
  32. package/node_modules/appium-android-driver/lib/commands/media-stream/constants.ts +4 -0
  33. package/node_modules/appium-android-driver/lib/commands/media-stream/exports.ts +51 -17
  34. package/node_modules/appium-android-driver/lib/commands/media-stream/stream.ts +60 -40
  35. package/node_modules/appium-android-driver/lib/driver.ts +1 -0
  36. package/node_modules/appium-android-driver/package.json +4 -4
  37. package/node_modules/appium-uiautomator2-server/CHANGELOG.md +63 -0
  38. package/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk +0 -0
  39. package/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk.idsig +0 -0
  40. package/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v11.1.1.apk +0 -0
  41. package/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v11.1.1.apk.idsig +0 -0
  42. package/node_modules/appium-uiautomator2-server/package.json +2 -3
  43. package/node_modules/asyncbox/README.md +7 -3
  44. package/node_modules/asyncbox/build/lib/shared/errors.d.ts +18 -2
  45. package/node_modules/asyncbox/build/lib/shared/errors.d.ts.map +1 -1
  46. package/node_modules/asyncbox/build/lib/shared/errors.js +24 -8
  47. package/node_modules/asyncbox/build/lib/shared/errors.js.map +1 -1
  48. package/node_modules/asyncbox/lib/shared/errors.ts +34 -8
  49. package/node_modules/asyncbox/package.json +1 -1
  50. package/node_modules/bare-fs/package.json +2 -2
  51. package/node_modules/bare-fs/prebuilds/darwin-arm64/bare-fs.bare +0 -0
  52. package/node_modules/bare-fs/prebuilds/linux-arm64/bare-fs.bare +0 -0
  53. package/node_modules/bare-fs/prebuilds/linux-x64/bare-fs.bare +0 -0
  54. package/node_modules/bare-fs/prebuilds/win32-x64/bare-fs.bare +0 -0
  55. package/node_modules/io.appium.settings/CHANGELOG.md +14 -0
  56. package/node_modules/io.appium.settings/apks/settings_apk-debug.apk +0 -0
  57. package/node_modules/io.appium.settings/package.json +2 -2
  58. package/node_modules/plist/dist/parse-binary.d.ts.map +1 -1
  59. package/node_modules/plist/dist/parse-binary.js +37 -9
  60. package/node_modules/plist/dist/parse-binary.js.map +1 -1
  61. package/node_modules/plist/package.json +1 -1
  62. package/package.json +5 -5
  63. package/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v11.0.8.apk +0 -0
  64. package/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v11.0.8.apk.idsig +0 -0
@@ -50,13 +50,19 @@ export class MediaStream {
50
50
  private dropped = 0;
51
51
  private heartbeat?: NodeJS.Timeout;
52
52
  private pump?: Promise<void>;
53
- // Whether the device-side session is ours to stop (false if another client's stream was found running)
54
- private owned = false;
53
+ /**
54
+ * Settles once the device session is up or failed to start, telling whether there is a device
55
+ * session of ours to stop. False if another client's stream of this kind was found running, or if
56
+ * the options were rejected (TypeError, RangeError) before the device was touched. Any other
57
+ * failure may have brought the on-device service up, so it counts as ours.
58
+ */
59
+ private deviceStart?: Promise<boolean>;
55
60
  private announced = false;
56
61
  private endReason = 'ended';
57
62
  private firstUnitSeen!: () => void;
58
63
  private readonly firstUnit = new Promise<void>((resolve) => (this.firstUnitSeen = resolve));
59
64
  private stopped = false;
65
+ private finished?: Promise<void>;
60
66
  private get videoChain(): string {
61
67
  return `${this.streamId}:video`;
62
68
  }
@@ -70,46 +76,40 @@ export class MediaStream {
70
76
  this.batcher = new UnitBatcher(opts.kind === 'jpeg' ? 0 : opts.batchMs, (units) => this.emitUnits(units));
71
77
  }
72
78
 
79
+ /**
80
+ * Starts the device session and republishes its units.
81
+ * Throws if another client's stream of this kind runs on the device, which is left alone.
82
+ * If the stream is stopped while the device session is starting, this throws and the teardown
83
+ * stops the device session once it is up.
84
+ */
73
85
  async start(): Promise<MediaStreamInfo> {
74
86
  const {opts} = this;
75
87
  if (this.stopped) {
76
88
  throw new Error('The stream was stopped before it started');
77
89
  }
78
- // A start() that throws may still have brought the on-device service up, so it is ours
79
- this.owned = true;
80
- let started: boolean;
81
- try {
82
- started =
83
- opts.kind === 'video'
84
- ? await (this.session as VideoStreamSession).start({
85
- codec: opts.codec,
86
- fps: opts.fps,
87
- bitrate: opts.bitrate,
88
- resolution: opts.resolution,
89
- audio: opts.audio,
90
- })
91
- : await (this.session as JpegStreamSession).start({fps: opts.fps, quality: opts.quality, scale: opts.scale});
92
- } catch (e) {
93
- // Option validation runs before the device is touched, so there is nothing of ours to stop
94
- if (e instanceof TypeError || e instanceof RangeError) {
95
- this.owned = false;
96
- }
97
- if (this.owned && this.stopped) {
98
- // finish() already ran and skipped the device session, which may be half up
99
- await this.session.stop().catch(() => {});
90
+ const starting =
91
+ opts.kind === 'video'
92
+ ? (this.session as VideoStreamSession).start({
93
+ codec: opts.codec,
94
+ fps: opts.fps,
95
+ bitrate: opts.bitrate,
96
+ resolution: opts.resolution,
97
+ audio: opts.audio,
98
+ })
99
+ : (this.session as JpegStreamSession).start({fps: opts.fps, quality: opts.quality, scale: opts.scale});
100
+ this.deviceStart = (async () => {
101
+ try {
102
+ return await starting;
103
+ } catch (e) {
104
+ return !(e instanceof TypeError || e instanceof RangeError);
100
105
  }
101
- throw e;
106
+ })();
107
+ if (!(await starting)) {
108
+ throw new Error(`Another ${opts.kind} stream is already running on the device`);
102
109
  }
103
110
  if (this.stopped) {
104
- // Stopped while the device session was starting: finish() may have run before it was up
105
- await this.session.stop().catch(() => {});
106
111
  throw new Error('The stream was stopped while it was starting');
107
112
  }
108
- if (!started) {
109
- // The device already runs a stream of this kind that is not ours: leave it alone
110
- this.owned = false;
111
- throw new Error(`Another ${opts.kind} stream is already running on the device`);
112
- }
113
113
 
114
114
  this.deps.emitter.on(BACKPRESSURE_EVENT_NAME, this.onBackpressure);
115
115
  if (opts.kind === 'jpeg' && opts.idleHeartbeatMs > 0) {
@@ -164,22 +164,38 @@ export class MediaStream {
164
164
  return this.stopped;
165
165
  }
166
166
 
167
- /** Idempotent; resolves once the stream is torn down and its pump has finished. */
167
+ /**
168
+ * Idempotent: every call waits for the same teardown, and resolves once the device session of
169
+ * the stream is stopped (after its start settled, if it was still starting) and the pump has
170
+ * finished. Never rejects.
171
+ */
168
172
  async stop(reason = 'stopped'): Promise<void> {
169
173
  await this.finish(reason);
170
174
  await this.pump?.catch(() => {});
171
175
  }
172
176
 
173
- // Must not await the pump: it is also called from inside the pump itself
174
- private async finish(reason: string): Promise<void> {
175
- if (this.stopped) {
176
- return;
177
- }
177
+ /**
178
+ * Marks the stream stopped and returns its single teardown.
179
+ * Must not await the pump: it is also called from inside the pump itself.
180
+ */
181
+ private finish(reason: string): Promise<void> {
178
182
  this.stopped = true;
183
+ return (this.finished ??= this.teardown(reason));
184
+ }
185
+
186
+ /**
187
+ * Waits for a device start that is still in flight (a starting device session can only be
188
+ * stopped once it is up), stops the device session if it is ours, emits `ended`, and calls
189
+ * `onEnded`. Never rejects: the stream is ended whatever its device session or a listener of
190
+ * `ended` does, so failures of either are logged, not passed to the callers of stop().
191
+ * It awaits before running any callback, so finish() has stored it by the time a callback stops
192
+ * the stream again, and that call gets this same teardown.
193
+ */
194
+ private async teardown(reason: string): Promise<void> {
179
195
  clearInterval(this.heartbeat);
180
196
  this.batcher.close();
181
197
  this.deps.emitter.off(BACKPRESSURE_EVENT_NAME, this.onBackpressure);
182
- if (this.owned) {
198
+ if (await this.deviceStart) {
183
199
  try {
184
200
  await this.session.stop();
185
201
  } catch (e) {
@@ -187,7 +203,11 @@ export class MediaStream {
187
203
  }
188
204
  }
189
205
  if (this.announced) {
190
- this.deps.emit({method: MEDIA_ENDED_EVENT, params: {streamId: this.streamId, reason}});
206
+ try {
207
+ this.deps.emit({method: MEDIA_ENDED_EVENT, params: {streamId: this.streamId, reason}});
208
+ } catch (e) {
209
+ this.deps.log.warn(`Cannot emit the end of the ${this.kind} stream: ${(e as Error).message}`);
210
+ }
191
211
  }
192
212
  this.deps.onEnded(this.streamId);
193
213
  }
@@ -267,6 +267,7 @@ class AndroidDriver<C extends AndroidDriverConstraints = AndroidDriverConstraint
267
267
  _screenStreamingProps?: ScreenStreamingProps;
268
268
  _mediaStreams?: Map<string, MediaStream>;
269
269
  _endedMediaStreamIds?: Set<string>;
270
+ _mediaStreamsClosed?: boolean;
270
271
  _screenRecordingProperties?: ScreenRecordingProperties;
271
272
  _logcatWebsocketListener?: LogcatListener;
272
273
  _bidiServerLogListener?: (...args: any[]) => void;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-android-driver",
3
- "version": "15.4.0",
3
+ "version": "15.4.5",
4
4
  "description": "Android UiAutomator and Chrome support for Appium",
5
5
  "keywords": [
6
6
  "android",
@@ -52,10 +52,10 @@
52
52
  "@appium/support": "^8.0.0-beta.7",
53
53
  "appium-adb": "^17.0.4",
54
54
  "appium-chromedriver": "^10.0.6",
55
- "asyncbox": "^7.0.0",
55
+ "asyncbox": "^7.1.0",
56
56
  "axios": "^1.18.0",
57
57
  "dayjs": "^1.11.21",
58
- "io.appium.settings": "^9.2.1",
58
+ "io.appium.settings": "^9.2.3",
59
59
  "lru-cache": "^11.1.0",
60
60
  "semver": "^7.0.0",
61
61
  "teen_process": "^5.0.0",
@@ -77,5 +77,5 @@
77
77
  "node": "^22.22.2 || ^24.15.0 || >=26.0.0",
78
78
  "npm": ">=10"
79
79
  },
80
- "gitHead": "5ce17ee0415454b5eac479d6b200ac9a0b52e268"
80
+ "gitHead": "f648f6b1227f663fad7d02bcab71f4b655333a38"
81
81
  }
@@ -3,6 +3,69 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [11.1.1](https://github.com/appium/appium-android/compare/appium-uiautomator2-server@11.1.0...appium-uiautomator2-server@11.1.1) (2026-11-20)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **uiautomator2-server:** clamp rectangle gestures to the display ([#160](https://github.com/appium/appium-android/issues/160)) ([aa3537b](https://github.com/appium/appium-android/commit/aa3537ba220a0e54e5a629165ef4321a29c597fe))
11
+
12
+
13
+ ## [11.1.0](https://github.com/appium/appium-android/compare/appium-uiautomator2-server@11.0.15...appium-uiautomator2-server@11.1.0) (2026-11-20)
14
+
15
+ ### Features
16
+
17
+ * **uiautomator2-server:** scroll the first scrollable view by default ([#161](https://github.com/appium/appium-android/issues/161)) ([a5db1da](https://github.com/appium/appium-android/commit/a5db1dad491a4cfa7c7ff14f899fe0c4af3d1b9f))
18
+
19
+
20
+ ## [11.0.15](https://github.com/appium/appium-android/compare/appium-uiautomator2-server@11.0.14...appium-uiautomator2-server@11.0.15) (2026-11-20)
21
+
22
+ ### Bug Fixes
23
+
24
+ * **uiautomator2-server:** reject zero percent in scroll gesture ([#159](https://github.com/appium/appium-android/issues/159)) ([8fb8cf1](https://github.com/appium/appium-android/commit/8fb8cf1537eccd4ebb8efc03c6128f534f7b2b0c))
25
+
26
+
27
+ ## [11.0.14](https://github.com/appium/appium-android/compare/appium-uiautomator2-server@11.0.13...appium-uiautomator2-server@11.0.14) (2026-11-20)
28
+
29
+ ### Bug Fixes
30
+
31
+ * **uiautomator2-server:** clarify scroll and wheel action error messages ([#158](https://github.com/appium/appium-android/issues/158)) ([3d09610](https://github.com/appium/appium-android/commit/3d096107e4555824e22f7cfd00b4829d7bd175b7))
32
+
33
+
34
+ ## [11.0.13](https://github.com/appium/appium-android/compare/appium-uiautomator2-server@11.0.12...appium-uiautomator2-server@11.0.13) (2026-11-20)
35
+
36
+ ### Code Refactoring
37
+
38
+ * **uiautomator2-server:** replace reflection with public APIs ([#140](https://github.com/appium/appium-android/issues/140)) ([29c444f](https://github.com/appium/appium-android/commit/29c444f5e8866aa4e110bbdb47fe9a3917b20148))
39
+
40
+
41
+ ## [11.0.12](https://github.com/appium/appium-android/compare/appium-uiautomator2-server@11.0.11...appium-uiautomator2-server@11.0.12) (2026-11-20)
42
+
43
+ ### Miscellaneous Chores
44
+
45
+ * **gradle:** update dependency com.github.appium.appium-android:xpath2-processor to v2.0.6 ([#156](https://github.com/appium/appium-android/issues/156)) ([acbdc92](https://github.com/appium/appium-android/commit/acbdc92edf2c7217c3f1f847cd218b190eb96594))
46
+
47
+
48
+ ## [11.0.11](https://github.com/appium/appium-android/compare/appium-uiautomator2-server@11.0.10...appium-uiautomator2-server@11.0.11) (2026-11-19)
49
+
50
+ ### Miscellaneous Chores
51
+
52
+ * **uiautomator2-server:** bump AGP to 9.5.1 and Gradle to 9.9.1 ([#146](https://github.com/appium/appium-android/issues/146)) ([bdc987d](https://github.com/appium/appium-android/commit/bdc987d186235023787f5791b9c757c6df0c525e)), closes [#144](https://github.com/appium/appium-android/issues/144) [#145](https://github.com/appium/appium-android/issues/145)
53
+
54
+
55
+ ## [11.0.10](https://github.com/appium/appium-android/compare/appium-uiautomator2-server@11.0.9...appium-uiautomator2-server@11.0.10) (2026-11-19)
56
+
57
+ ### Miscellaneous Chores
58
+
59
+ * **gradle:** update dependency com.github.appium.appium-android:xpath2-processor to v2.0.3 ([#142](https://github.com/appium/appium-android/issues/142)) ([7f6b0ce](https://github.com/appium/appium-android/commit/7f6b0ce91471414d08fd6b0fe27e53ed60bae36a))
60
+
61
+
62
+ ## [11.0.9](https://github.com/appium/appium-android/compare/appium-uiautomator2-server@11.0.8...appium-uiautomator2-server@11.0.9) (2026-11-18)
63
+
64
+ ### Miscellaneous Chores
65
+
66
+ * **uiautomator2-server:** bump server dependencies ([#138](https://github.com/appium/appium-android/issues/138)) ([2e66e88](https://github.com/appium/appium-android/commit/2e66e8826de34ca4f1c646340c27b41738cce080))
67
+
68
+
6
69
  ## [11.0.8](https://github.com/appium/appium-android/compare/appium-uiautomator2-server@11.0.7...appium-uiautomator2-server@11.0.8) (2026-11-17)
7
70
 
8
71
  **Note:** Version bump only for package appium-uiautomator2-server
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appium-uiautomator2-server",
3
- "version": "11.0.8",
3
+ "version": "11.1.1",
4
4
  "description": "A netty server with uiautomator2 handlers",
5
5
  "keywords": [
6
6
  "android",
@@ -56,6 +56,5 @@
56
56
  "engines": {
57
57
  "node": "^22.22.2 || ^24.15.0 || >=26.0.0",
58
58
  "npm": ">=10"
59
- },
60
- "gitHead": "d3c3bdc927cdf82b47f8ae8ff2516ed525a74b73"
59
+ }
61
60
  }
@@ -253,9 +253,13 @@ Times are in ms, up to 2147483647, and `0` means no limit.
253
253
 
254
254
  ### Errors
255
255
 
256
- The built-in errors of this package extend `AsyncboxError` and carry a stable `code`,
257
- so match them by `instanceof` or `err.code` instead of the message text. Caller-supplied
258
- errors (e.g. the `error` option of `waitForCondition`) are passed through as is:
256
+ The built-in errors of this package extend `AsyncboxError` and carry a stable `code`
257
+ (also available as a static property of each class), so match them by `Class.is(err)`
258
+ instead of the message text. Unlike `instanceof`, `is` also matches by `code`, so it works
259
+ for errors created by another copy of this package (e.g. a transitive dependency pinning
260
+ another version). A subclass is recognized by `instanceof` only: `TimeoutError.is` does not
261
+ match a `ConditionUnmetError` of another copy. Caller-supplied errors (e.g. the `error`
262
+ option of `waitForCondition`) are passed through as is:
259
263
 
260
264
  | Class | `code` | Thrown by |
261
265
  | --- | --- | --- |
@@ -1,27 +1,43 @@
1
- /** Base class of the built-in typed errors of this package; match by `instanceof` or {@link AsyncboxError.code}. */
1
+ /** Base class of the built-in typed errors of this package; match by {@link AsyncboxError.is} or `code`. */
2
2
  export declare class AsyncboxError extends Error {
3
- /** Stable machine-readable identifier, e.g. `ERR_ASYNCBOX_TIMEOUT` */
3
+ /** Stable machine-readable identifier of the error class, e.g. `ERR_ASYNCBOX_TIMEOUT` */
4
+ static readonly code: string;
5
+ /** Same as the static `code` of the error class */
4
6
  readonly code: string;
5
7
  constructor(message: string, code?: string);
8
+ /**
9
+ * Whether `err` is an instance of this error class. Unlike a bare `instanceof`, it also
10
+ * matches by `code`, so errors created by another copy of this package are recognized.
11
+ * Subclasses are matched by `instanceof` only, i.e. `TimeoutError.is` does not match a
12
+ * `ConditionUnmetError` created by another copy.
13
+ */
14
+ static is<E extends AsyncboxError>(this: (abstract new (...args: any[]) => E) & {
15
+ code: string;
16
+ }, err: unknown): err is E;
6
17
  }
7
18
  /** Error thrown by {@link withTimeout} when the deadline is exceeded. */
8
19
  export declare class TimeoutError extends AsyncboxError {
20
+ static readonly code: string;
9
21
  constructor(message?: string, code?: string);
10
22
  }
11
23
  /** Thrown by {@link waitForCondition} when the condition is not met in time. */
12
24
  export declare class ConditionUnmetError extends TimeoutError {
25
+ static readonly code = "ERR_ASYNCBOX_CONDITION_UNMET";
13
26
  constructor(message?: string);
14
27
  }
15
28
  /** Thrown by {@link AsyncLock} when a queue, execution or occupation time limit is exceeded. */
16
29
  export declare class LockTimeoutError extends TimeoutError {
30
+ static readonly code = "ERR_ASYNCBOX_LOCK_TIMEOUT";
17
31
  constructor(message?: string);
18
32
  }
19
33
  /** Thrown by {@link AsyncLock} when the queue of a key already holds `maxPending` tasks. */
20
34
  export declare class LockQueueFullError extends AsyncboxError {
35
+ static readonly code = "ERR_ASYNCBOX_LOCK_QUEUE_FULL";
21
36
  constructor(message?: string);
22
37
  }
23
38
  /** Thrown when a promise is cancelled via `cancel`. */
24
39
  export declare class PromiseCancellationError extends AsyncboxError {
40
+ static readonly code = "ERR_ASYNCBOX_CANCELLED";
25
41
  constructor(message?: string);
26
42
  }
27
43
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../lib/shared/errors.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,qBAAa,aAAc,SAAQ,KAAK;IACtC,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAuB;CAK3D;AAED,yEAAyE;AACzE,qBAAa,YAAa,SAAQ,aAAa;gBACjC,OAAO,CAAC,EAAE,MAAM,EAAE,I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SAAQ,YAAY;IAChD,gBAAyB,IAAI,+BAA+B;gBAEhD,OAAO,CAAC,EAAE,MAAM;CAI7B;AAED,4FAA4F;AAC5F,qBAAa,kBAAmB,SAAQ,aAAa;IACnD,gBAAyB,IAAI,kCAAkC;gBAEnD,OAAO,CAAC,EAAE,MAAM;CAI7B;AAED,uDAAuD;AACvD,qBAAa,wBAAyB,SAAQ,aAAa;IACzD,gBAAyB,IAAI,4BAA4B;gBAE7C,OAAO,GAAE,MAA4B;CAIlD"}
@@ -1,45 +1,61 @@
1
- /** Base class of the built-in typed errors of this package; match by `instanceof` or {@link AsyncboxError.code}. */
1
+ /** Base class of the built-in typed errors of this package; match by {@link AsyncboxError.is} or `code`. */
2
2
  export class AsyncboxError extends Error {
3
- /** Stable machine-readable identifier, e.g. `ERR_ASYNCBOX_TIMEOUT` */
3
+ /** Stable machine-readable identifier of the error class, e.g. `ERR_ASYNCBOX_TIMEOUT` */
4
+ static code = 'ERR_ASYNCBOX';
5
+ /** Same as the static `code` of the error class */
4
6
  code;
5
- constructor(message, code = 'ERR_ASYNCBOX') {
7
+ constructor(message, code = new.target.code) {
6
8
  super(message);
7
9
  this.name = 'AsyncboxError';
8
10
  this.code = code;
9
11
  }
12
+ /**
13
+ * Whether `err` is an instance of this error class. Unlike a bare `instanceof`, it also
14
+ * matches by `code`, so errors created by another copy of this package are recognized.
15
+ * Subclasses are matched by `instanceof` only, i.e. `TimeoutError.is` does not match a
16
+ * `ConditionUnmetError` created by another copy.
17
+ */
18
+ static is(err) {
19
+ return err instanceof this || (err instanceof Error && err.code === this.code);
20
+ }
10
21
  }
11
22
  /** Error thrown by {@link withTimeout} when the deadline is exceeded. */
12
23
  export class TimeoutError extends AsyncboxError {
13
- constructor(message, code = 'ERR_ASYNCBOX_TIMEOUT') {
24
+ static code = 'ERR_ASYNCBOX_TIMEOUT';
25
+ constructor(message, code) {
14
26
  super(message ?? 'Operation timed out', code);
15
27
  this.name = 'TimeoutError';
16
28
  }
17
29
  }
18
30
  /** Thrown by {@link waitForCondition} when the condition is not met in time. */
19
31
  export class ConditionUnmetError extends TimeoutError {
32
+ static code = 'ERR_ASYNCBOX_CONDITION_UNMET';
20
33
  constructor(message) {
21
- super(message ?? 'Condition unmet', 'ERR_ASYNCBOX_CONDITION_UNMET');
34
+ super(message ?? 'Condition unmet');
22
35
  this.name = 'ConditionUnmetError';
23
36
  }
24
37
  }
25
38
  /** Thrown by {@link AsyncLock} when a queue, execution or occupation time limit is exceeded. */
26
39
  export class LockTimeoutError extends TimeoutError {
40
+ static code = 'ERR_ASYNCBOX_LOCK_TIMEOUT';
27
41
  constructor(message) {
28
- super(message ?? 'Lock timed out', 'ERR_ASYNCBOX_LOCK_TIMEOUT');
42
+ super(message ?? 'Lock timed out');
29
43
  this.name = 'LockTimeoutError';
30
44
  }
31
45
  }
32
46
  /** Thrown by {@link AsyncLock} when the queue of a key already holds `maxPending` tasks. */
33
47
  export class LockQueueFullError extends AsyncboxError {
48
+ static code = 'ERR_ASYNCBOX_LOCK_QUEUE_FULL';
34
49
  constructor(message) {
35
- super(message ?? 'Too many pending tasks in queue', 'ERR_ASYNCBOX_LOCK_QUEUE_FULL');
50
+ super(message ?? 'Too many pending tasks in queue');
36
51
  this.name = 'LockQueueFullError';
37
52
  }
38
53
  }
39
54
  /** Thrown when a promise is cancelled via `cancel`. */
40
55
  export class PromiseCancellationError extends AsyncboxError {
56
+ static code = 'ERR_ASYNCBOX_CANCELLED';
41
57
  constructor(message = 'Promise cancelled') {
42
- super(message, 'ERR_ASYNCBOX_CANCELLED');
58
+ super(message);
43
59
  this.name = 'PromiseCancellationError';
44
60
  }
45
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../lib/shared/errors.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,sEAAsE;IAC7D,IAAI,CAAS;IAEtB,YAAY,OAAe,EAAE,OAAe,cAAc;QACxD,K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AC5F,MAAM,OAAO,kBAAmB,SAAQ,aAAa;IACnD,MAAM,CAAmB,IAAI,GAAG,8BAA8B,CAAC;IAE/D,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,IAAI,iCAAiC,CAAC,CAAC;QACpD,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;;AAGH,uDAAuD;AACvD,MAAM,OAAO,wBAAyB,SAAQ,aAAa;IACzD,MAAM,CAAmB,IAAI,GAAG,wBAAwB,CAAC;IAEzD,YAAY,UAAkB,mBAAmB;QAC/C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACzC,CAAC"}
@@ -1,18 +1,36 @@
1
- /** Base class of the built-in typed errors of this package; match by `instanceof` or {@link AsyncboxError.code}. */
1
+ /** Base class of the built-in typed errors of this package; match by {@link AsyncboxError.is} or `code`. */
2
2
  export class AsyncboxError extends Error {
3
- /** Stable machine-readable identifier, e.g. `ERR_ASYNCBOX_TIMEOUT` */
3
+ /** Stable machine-readable identifier of the error class, e.g. `ERR_ASYNCBOX_TIMEOUT` */
4
+ static readonly code: string = 'ERR_ASYNCBOX';
5
+
6
+ /** Same as the static `code` of the error class */
4
7
  readonly code: string;
5
8
 
6
- constructor(message: string, code: string = 'ERR_ASYNCBOX') {
9
+ constructor(message: string, code: string = new.target.code) {
7
10
  super(message);
8
11
  this.name = 'AsyncboxError';
9
12
  this.code = code;
10
13
  }
14
+
15
+ /**
16
+ * Whether `err` is an instance of this error class. Unlike a bare `instanceof`, it also
17
+ * matches by `code`, so errors created by another copy of this package are recognized.
18
+ * Subclasses are matched by `instanceof` only, i.e. `TimeoutError.is` does not match a
19
+ * `ConditionUnmetError` created by another copy.
20
+ */
21
+ static is<E extends AsyncboxError>(
22
+ this: (abstract new (...args: any[]) => E) & {code: string},
23
+ err: unknown,
24
+ ): err is E {
25
+ return err instanceof this || (err instanceof Error && (err as {code?: unknown}).code === this.code);
26
+ }
11
27
  }
12
28
 
13
29
  /** Error thrown by {@link withTimeout} when the deadline is exceeded. */
14
30
  export class TimeoutError extends AsyncboxError {
15
- constructor(message?: string, code: string = 'ERR_ASYNCBOX_TIMEOUT') {
31
+ static override readonly code: string = 'ERR_ASYNCBOX_TIMEOUT';
32
+
33
+ constructor(message?: string, code?: string) {
16
34
  super(message ?? 'Operation timed out', code);
17
35
  this.name = 'TimeoutError';
18
36
  }
@@ -20,32 +38,40 @@ export class TimeoutError extends AsyncboxError {
20
38
 
21
39
  /** Thrown by {@link waitForCondition} when the condition is not met in time. */
22
40
  export class ConditionUnmetError extends TimeoutError {
41
+ static override readonly code = 'ERR_ASYNCBOX_CONDITION_UNMET';
42
+
23
43
  constructor(message?: string) {
24
- super(message ?? 'Condition unmet', 'ERR_ASYNCBOX_CONDITION_UNMET');
44
+ super(message ?? 'Condition unmet');
25
45
  this.name = 'ConditionUnmetError';
26
46
  }
27
47
  }
28
48
 
29
49
  /** Thrown by {@link AsyncLock} when a queue, execution or occupation time limit is exceeded. */
30
50
  export class LockTimeoutError extends TimeoutError {
51
+ static override readonly code = 'ERR_ASYNCBOX_LOCK_TIMEOUT';
52
+
31
53
  constructor(message?: string) {
32
- super(message ?? 'Lock timed out', 'ERR_ASYNCBOX_LOCK_TIMEOUT');
54
+ super(message ?? 'Lock timed out');
33
55
  this.name = 'LockTimeoutError';
34
56
  }
35
57
  }
36
58
 
37
59
  /** Thrown by {@link AsyncLock} when the queue of a key already holds `maxPending` tasks. */
38
60
  export class LockQueueFullError extends AsyncboxError {
61
+ static override readonly code = 'ERR_ASYNCBOX_LOCK_QUEUE_FULL';
62
+
39
63
  constructor(message?: string) {
40
- super(message ?? 'Too many pending tasks in queue', 'ERR_ASYNCBOX_LOCK_QUEUE_FULL');
64
+ super(message ?? 'Too many pending tasks in queue');
41
65
  this.name = 'LockQueueFullError';
42
66
  }
43
67
  }
44
68
 
45
69
  /** Thrown when a promise is cancelled via `cancel`. */
46
70
  export class PromiseCancellationError extends AsyncboxError {
71
+ static override readonly code = 'ERR_ASYNCBOX_CANCELLED';
72
+
47
73
  constructor(message: string = 'Promise cancelled') {
48
- super(message, 'ERR_ASYNCBOX_CANCELLED');
74
+ super(message);
49
75
  this.name = 'PromiseCancellationError';
50
76
  }
51
77
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asyncbox",
3
- "version": "7.0.0",
3
+ "version": "7.1.0",
4
4
  "description": "A collection of small async/await utilities",
5
5
  "keywords": [
6
6
  "async",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-fs",
3
- "version": "4.8.4",
3
+ "version": "4.8.5",
4
4
  "description": "Native file system operations for Bare",
5
5
  "exports": {
6
6
  "./package": "./package.json",
@@ -59,7 +59,7 @@
59
59
  "bare-crypto": "^1.11.2",
60
60
  "bare-thread": "^1.2.6",
61
61
  "brittle": "^3.1.1",
62
- "cmake-bare": "^1.1.7",
62
+ "cmake-bare": "^1.18.0",
63
63
  "lunte": "^1.6.0",
64
64
  "prettier": "^3.4.1",
65
65
  "prettier-config-holepunch": "^2.0.0"
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [9.2.3](https://github.com/appium/appium-android/compare/io.appium.settings@9.2.2...io.appium.settings@9.2.3) (2026-11-19)
7
+
8
+ ### Miscellaneous Chores
9
+
10
+ * **wrapper:** update gradle to v9.9.1 ([#147](https://github.com/appium/appium-android/issues/147)) ([ac49a3c](https://github.com/appium/appium-android/commit/ac49a3c6e46928b1874733b62826d38d9b41e653))
11
+
12
+
13
+ ## [9.2.2](https://github.com/appium/appium-android/compare/io.appium.settings@9.2.1...io.appium.settings@9.2.2) (2026-11-19)
14
+
15
+ ### Miscellaneous Chores
16
+
17
+ * **settings:** update dependency com.android.tools.build:gradle to v9.5.1 ([#139](https://github.com/appium/appium-android/issues/139)) ([a65bae7](https://github.com/appium/appium-android/commit/a65bae7546cb4563ca745f64899d5698a5a1793f))
18
+
19
+
6
20
  ## [9.2.1](https://github.com/appium/appium-android/compare/io.appium.settings@9.2.0...io.appium.settings@9.2.1) (2026-11-17)
7
21
 
8
22
  ### Miscellaneous Chores
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "io.appium.settings",
3
- "version": "9.2.1",
3
+ "version": "9.2.3",
4
4
  "description": "App for dealing with Android settings",
5
5
  "keywords": [
6
6
  "android",
@@ -70,5 +70,5 @@
70
70
  "node": "^22.22.2 || ^24.15.0 || >=26.0.0",
71
71
  "npm": ">=10"
72
72
  },
73
- "gitHead": "d3c3bdc927cdf82b47f8ae8ff2516ed525a74b73"
73
+ "gitHead": "f648f6b1227f663fad7d02bcab71f4b655333a38"
74
74
  }
@@ -1 +1 @@
1
- {"version":3,"file":"parse-binary.d.ts","sourceRoot":"","sources":["../src/parse-binary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAqB7C;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAgLxD"}
1
+ {"version":3,"file":"parse-binary.d.ts","sourceRoot":"","sources":["../src/parse-binary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAqB7C;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CA8MxD"}