@testerpaykit/expo 2.0.0 → 2.0.1

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  All notable changes to `@testerpaykit/expo` are documented here.
4
4
 
5
+ ## 2.0.1 — 2026-11-08
6
+
7
+ ### Fixed
8
+ - A login the server no longer knows (401, or 404 "Tester not found" on
9
+ the profile, e.g. one carried over from 1.x) is dropped with its session
10
+ and phone state; the SDK logs in anonymously again and asks once more.
11
+ Before, the verification sheet only ever said "no connection" (Cenavo).
12
+ - `package.json` exports `./app.plugin.js`, so Expo loads the config
13
+ plugin without a warning.
14
+
5
15
  ## 2.0.0 — 2026-11-07
6
16
 
7
17
  Breaking: tester UI only for confirmed and approved testers; local earnings props removed. Same release as Flutter, Web and Swift 2.0.0. Needs `@testerpaykit/api-client` 2.0.0.
package/dist/index.d.mts CHANGED
@@ -833,6 +833,13 @@ declare class TpkExpo {
833
833
  phoneStatus(options?: {
834
834
  revalidate?: boolean;
835
835
  }): Promise<'verified' | 'required' | 'awaitingApproval' | 'unknown'>;
836
+ private loginRecovery;
837
+ /**
838
+ * Drop a login the server no longer accepts, with its session and phone
839
+ * state, and log in anonymously again, like a first start. Concurrent
840
+ * callers share one login. False when the fresh login failed too.
841
+ */
842
+ private recoverDeadLogin;
836
843
  /** See [TpkAccess]. */
837
844
  get access(): TpkAccess;
838
845
  /** The tester's handle ("moinsen-uli") while access is ready and the
package/dist/index.d.ts CHANGED
@@ -833,6 +833,13 @@ declare class TpkExpo {
833
833
  phoneStatus(options?: {
834
834
  revalidate?: boolean;
835
835
  }): Promise<'verified' | 'required' | 'awaitingApproval' | 'unknown'>;
836
+ private loginRecovery;
837
+ /**
838
+ * Drop a login the server no longer accepts, with its session and phone
839
+ * state, and log in anonymously again, like a first start. Concurrent
840
+ * callers share one login. False when the fresh login failed too.
841
+ */
842
+ private recoverDeadLogin;
836
843
  /** See [TpkAccess]. */
837
844
  get access(): TpkAccess;
838
845
  /** The tester's handle ("moinsen-uli") while access is ready and the
package/dist/index.js CHANGED
@@ -1308,7 +1308,7 @@ function findAssignmentForTask(tasks, key) {
1308
1308
  }
1309
1309
 
1310
1310
  // package.json
1311
- var version = "2.0.0";
1311
+ var version = "2.0.1";
1312
1312
 
1313
1313
  // src/version.ts
1314
1314
  var SDK_VERSION = `@testerpaykit/expo/${version}`;
@@ -1521,6 +1521,7 @@ var TpkExpo = class _TpkExpo {
1521
1521
  this.verificationPresenter = null;
1522
1522
  /** Active server session id. Updated by init or rotate. Used to route telemetry. */
1523
1523
  this.sessionId = "";
1524
+ this.loginRecovery = null;
1524
1525
  this._ready = ready;
1525
1526
  }
1526
1527
  /**
@@ -1822,7 +1823,14 @@ var TpkExpo = class _TpkExpo {
1822
1823
  if (cachedOk && !options.revalidate) return "verified";
1823
1824
  let status;
1824
1825
  try {
1825
- const profile = await this.api.getMyProfile();
1826
+ let profile;
1827
+ try {
1828
+ profile = await this.api.getMyProfile();
1829
+ } catch (e) {
1830
+ const code = extractStatus2(e);
1831
+ if (code !== 401 && code !== 404 || !await this.recoverDeadLogin()) throw e;
1832
+ profile = await this.api.getMyProfile();
1833
+ }
1826
1834
  if (!profile.phoneVerified) status = "required";
1827
1835
  else if (profile.approved !== true) status = "awaitingApproval";
1828
1836
  else {
@@ -1840,6 +1848,33 @@ var TpkExpo = class _TpkExpo {
1840
1848
  }
1841
1849
  return status;
1842
1850
  }
1851
+ /**
1852
+ * Drop a login the server no longer accepts, with its session and phone
1853
+ * state, and log in anonymously again, like a first start. Concurrent
1854
+ * callers share one login. False when the fresh login failed too.
1855
+ */
1856
+ recoverDeadLogin() {
1857
+ this.loginRecovery ?? (this.loginRecovery = (async () => {
1858
+ try {
1859
+ await discardAuth(this.storage);
1860
+ await this.storage.remove(STORAGE_KEY_PHONE);
1861
+ const fresh = await this.api.loginAnonymous(this.config.projectId, this.config.testerCode);
1862
+ await this.storage.set(STORAGE_KEY_AUTH, fresh);
1863
+ this.tester = fresh.tester;
1864
+ try {
1865
+ this.sessionId = await startServerSession(this.api, fresh.tester.projectId);
1866
+ await persistSession(this.storage, this.sessionId, this.config.projectId, this.config.testerCode);
1867
+ } catch {
1868
+ }
1869
+ return true;
1870
+ } catch {
1871
+ return false;
1872
+ } finally {
1873
+ this.loginRecovery = null;
1874
+ }
1875
+ })());
1876
+ return this.loginRecovery;
1877
+ }
1843
1878
  /** See [TpkAccess]. */
1844
1879
  get access() {
1845
1880
  return this.accessValue;
package/dist/index.mjs CHANGED
@@ -1042,7 +1042,7 @@ function findAssignmentForTask(tasks, key) {
1042
1042
  }
1043
1043
 
1044
1044
  // package.json
1045
- var version = "2.0.0";
1045
+ var version = "2.0.1";
1046
1046
 
1047
1047
  // src/version.ts
1048
1048
  var SDK_VERSION = `@testerpaykit/expo/${version}`;
@@ -1255,6 +1255,7 @@ var TpkExpo = class _TpkExpo {
1255
1255
  this.verificationPresenter = null;
1256
1256
  /** Active server session id. Updated by init or rotate. Used to route telemetry. */
1257
1257
  this.sessionId = "";
1258
+ this.loginRecovery = null;
1258
1259
  this._ready = ready;
1259
1260
  }
1260
1261
  /**
@@ -1556,7 +1557,14 @@ var TpkExpo = class _TpkExpo {
1556
1557
  if (cachedOk && !options.revalidate) return "verified";
1557
1558
  let status;
1558
1559
  try {
1559
- const profile = await this.api.getMyProfile();
1560
+ let profile;
1561
+ try {
1562
+ profile = await this.api.getMyProfile();
1563
+ } catch (e) {
1564
+ const code = extractStatus2(e);
1565
+ if (code !== 401 && code !== 404 || !await this.recoverDeadLogin()) throw e;
1566
+ profile = await this.api.getMyProfile();
1567
+ }
1560
1568
  if (!profile.phoneVerified) status = "required";
1561
1569
  else if (profile.approved !== true) status = "awaitingApproval";
1562
1570
  else {
@@ -1574,6 +1582,33 @@ var TpkExpo = class _TpkExpo {
1574
1582
  }
1575
1583
  return status;
1576
1584
  }
1585
+ /**
1586
+ * Drop a login the server no longer accepts, with its session and phone
1587
+ * state, and log in anonymously again, like a first start. Concurrent
1588
+ * callers share one login. False when the fresh login failed too.
1589
+ */
1590
+ recoverDeadLogin() {
1591
+ this.loginRecovery ?? (this.loginRecovery = (async () => {
1592
+ try {
1593
+ await discardAuth(this.storage);
1594
+ await this.storage.remove(STORAGE_KEY_PHONE);
1595
+ const fresh = await this.api.loginAnonymous(this.config.projectId, this.config.testerCode);
1596
+ await this.storage.set(STORAGE_KEY_AUTH, fresh);
1597
+ this.tester = fresh.tester;
1598
+ try {
1599
+ this.sessionId = await startServerSession(this.api, fresh.tester.projectId);
1600
+ await persistSession(this.storage, this.sessionId, this.config.projectId, this.config.testerCode);
1601
+ } catch {
1602
+ }
1603
+ return true;
1604
+ } catch {
1605
+ return false;
1606
+ } finally {
1607
+ this.loginRecovery = null;
1608
+ }
1609
+ })());
1610
+ return this.loginRecovery;
1611
+ }
1577
1612
  /** See [TpkAccess]. */
1578
1613
  get access() {
1579
1614
  return this.accessValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testerpaykit/expo",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "TesterPayKit Expo / React-Native bindings — shake-to-report, device info, bug-report hook",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -11,7 +11,9 @@
11
11
  "react-native": "./dist/index.mjs",
12
12
  "import": "./dist/index.mjs",
13
13
  "require": "./dist/index.js"
14
- }
14
+ },
15
+ "./app.plugin.js": "./app.plugin.js",
16
+ "./package.json": "./package.json"
15
17
  },
16
18
  "files": [
17
19
  "dist",
@@ -22,8 +24,8 @@
22
24
  "dependencies": {
23
25
  "@noble/hashes": "^2.4.0",
24
26
  "@testerpaykit/api-client": "^2.0.0",
25
- "@testerpaykit/core": "1.3.0",
26
- "@testerpaykit/ai-tester": "0.5.1"
27
+ "@testerpaykit/ai-tester": "0.5.1",
28
+ "@testerpaykit/core": "1.3.0"
27
29
  },
28
30
  "peerDependencies": {
29
31
  "@expo/vector-icons": ">=14.0.0",