@testerpaykit/expo 2.1.0 → 2.1.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 +9 -0
- package/dist/index.d.mts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +38 -4
- package/dist/index.mjs +38 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@testerpaykit/expo` are documented here.
|
|
4
4
|
|
|
5
|
+
## 2.1.1 — 2026-11-09
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- With `syncSessions: false` a launch sends nothing at all until the first
|
|
9
|
+
report: no sign-in and no profile check. Signing in marked the tester as
|
|
10
|
+
active on every start, so "no tracking" was not quite true. A person approved
|
|
11
|
+
on an earlier launch still signs in at launch and sees the widget; confirming
|
|
12
|
+
a number signs in when it starts.
|
|
13
|
+
|
|
5
14
|
## 2.1.0 — 2026-11-09
|
|
6
15
|
|
|
7
16
|
### Added
|
package/dist/index.d.mts
CHANGED
|
@@ -766,6 +766,9 @@ declare class TpkExpo {
|
|
|
766
766
|
private readonly submittedCrashes;
|
|
767
767
|
private crashFlush;
|
|
768
768
|
private accessValue;
|
|
769
|
+
/** `syncSessions: false`: nothing reaches the server until a report does. */
|
|
770
|
+
private quietUntilReport;
|
|
771
|
+
private signingIn;
|
|
769
772
|
private handleValue;
|
|
770
773
|
/** Bumped by a tester-gate 403: a check that started before it must
|
|
771
774
|
* not bring a stale "ready" back. */
|
|
@@ -845,6 +848,12 @@ declare class TpkExpo {
|
|
|
845
848
|
revalidate?: boolean;
|
|
846
849
|
}): Promise<'verified' | 'required' | 'awaitingApproval' | 'unknown'>;
|
|
847
850
|
private loginRecovery;
|
|
851
|
+
/**
|
|
852
|
+
* Signs in for the first report when `syncSessions: false` left that open,
|
|
853
|
+
* or just ends the quiet with a stored login. Concurrent callers share one
|
|
854
|
+
* sign-in; a failure is retried by the next one.
|
|
855
|
+
*/
|
|
856
|
+
private signInForReport;
|
|
848
857
|
/**
|
|
849
858
|
* Drop a login the server no longer accepts, with its session and phone
|
|
850
859
|
* state, and log in anonymously again, like a first start. Concurrent
|
package/dist/index.d.ts
CHANGED
|
@@ -766,6 +766,9 @@ declare class TpkExpo {
|
|
|
766
766
|
private readonly submittedCrashes;
|
|
767
767
|
private crashFlush;
|
|
768
768
|
private accessValue;
|
|
769
|
+
/** `syncSessions: false`: nothing reaches the server until a report does. */
|
|
770
|
+
private quietUntilReport;
|
|
771
|
+
private signingIn;
|
|
769
772
|
private handleValue;
|
|
770
773
|
/** Bumped by a tester-gate 403: a check that started before it must
|
|
771
774
|
* not bring a stale "ready" back. */
|
|
@@ -845,6 +848,12 @@ declare class TpkExpo {
|
|
|
845
848
|
revalidate?: boolean;
|
|
846
849
|
}): Promise<'verified' | 'required' | 'awaitingApproval' | 'unknown'>;
|
|
847
850
|
private loginRecovery;
|
|
851
|
+
/**
|
|
852
|
+
* Signs in for the first report when `syncSessions: false` left that open,
|
|
853
|
+
* or just ends the quiet with a stored login. Concurrent callers share one
|
|
854
|
+
* sign-in; a failure is retried by the next one.
|
|
855
|
+
*/
|
|
856
|
+
private signInForReport;
|
|
848
857
|
/**
|
|
849
858
|
* Drop a login the server no longer accepts, with its session and phone
|
|
850
859
|
* state, and log in anonymously again, like a first start. Concurrent
|
package/dist/index.js
CHANGED
|
@@ -1335,7 +1335,7 @@ function findAssignmentForTask(tasks, key) {
|
|
|
1335
1335
|
}
|
|
1336
1336
|
|
|
1337
1337
|
// package.json
|
|
1338
|
-
var version = "2.1.
|
|
1338
|
+
var version = "2.1.1";
|
|
1339
1339
|
|
|
1340
1340
|
// src/version.ts
|
|
1341
1341
|
var SDK_VERSION = `@testerpaykit/expo/${version}`;
|
|
@@ -1540,6 +1540,9 @@ var TpkExpo = class _TpkExpo {
|
|
|
1540
1540
|
this.crashFlush = Promise.resolve();
|
|
1541
1541
|
// ── Access (who sees the widget) ──
|
|
1542
1542
|
this.accessValue = "hidden";
|
|
1543
|
+
/** `syncSessions: false`: nothing reaches the server until a report does. */
|
|
1544
|
+
this.quietUntilReport = false;
|
|
1545
|
+
this.signingIn = null;
|
|
1543
1546
|
this.handleValue = null;
|
|
1544
1547
|
/** Bumped by a tester-gate 403: a check that started before it must
|
|
1545
1548
|
* not bring a stale "ready" back. */
|
|
@@ -1593,6 +1596,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
1593
1596
|
let tester;
|
|
1594
1597
|
let authReady;
|
|
1595
1598
|
let hasCachedAuth = false;
|
|
1599
|
+
const signInLater = config.syncSessions === false && (await storage.get(STORAGE_KEY_PHONE))?.approved !== true;
|
|
1596
1600
|
const acquireFreshAuth = async () => {
|
|
1597
1601
|
try {
|
|
1598
1602
|
const fresh = await api.loginAnonymous(config.projectId, config.testerCode);
|
|
@@ -1608,7 +1612,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
1608
1612
|
authReady = Promise.resolve();
|
|
1609
1613
|
} else {
|
|
1610
1614
|
tester = { id: "", projectId: config.projectId, code: config.testerCode };
|
|
1611
|
-
authReady = acquireFreshAuth();
|
|
1615
|
+
authReady = signInLater ? Promise.resolve() : acquireFreshAuth();
|
|
1612
1616
|
}
|
|
1613
1617
|
let sessionId = "";
|
|
1614
1618
|
let sessionReady;
|
|
@@ -1659,6 +1663,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
1659
1663
|
);
|
|
1660
1664
|
instance.tester = tester;
|
|
1661
1665
|
instance.sessionId = sessionId;
|
|
1666
|
+
instance.quietUntilReport = signInLater;
|
|
1662
1667
|
sessionReady.then(() => {
|
|
1663
1668
|
instance.sessionId = sessionId;
|
|
1664
1669
|
});
|
|
@@ -1712,6 +1717,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
1712
1717
|
const payload = await this.buildPayload(input);
|
|
1713
1718
|
const idempotencyKey = uuidv4();
|
|
1714
1719
|
try {
|
|
1720
|
+
await this.signInForReport();
|
|
1715
1721
|
const response = await this.api.submitBugReport(payload, {
|
|
1716
1722
|
idempotencyKey
|
|
1717
1723
|
});
|
|
@@ -1855,6 +1861,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
1855
1861
|
const cached2 = await this.storage.get(STORAGE_KEY_PHONE);
|
|
1856
1862
|
const cachedOk = cached2?.approved === true;
|
|
1857
1863
|
if (cachedOk && !options.revalidate) return "verified";
|
|
1864
|
+
await this.signInForReport();
|
|
1858
1865
|
let status;
|
|
1859
1866
|
try {
|
|
1860
1867
|
let profile;
|
|
@@ -1882,6 +1889,29 @@ var TpkExpo = class _TpkExpo {
|
|
|
1882
1889
|
}
|
|
1883
1890
|
return status;
|
|
1884
1891
|
}
|
|
1892
|
+
/**
|
|
1893
|
+
* Signs in for the first report when `syncSessions: false` left that open,
|
|
1894
|
+
* or just ends the quiet with a stored login. Concurrent callers share one
|
|
1895
|
+
* sign-in; a failure is retried by the next one.
|
|
1896
|
+
*/
|
|
1897
|
+
signInForReport() {
|
|
1898
|
+
if (!this.quietUntilReport) return Promise.resolve();
|
|
1899
|
+
this.signingIn ?? (this.signingIn = (async () => {
|
|
1900
|
+
try {
|
|
1901
|
+
if (!this.tester.id) {
|
|
1902
|
+
const fresh = await this.api.loginAnonymous(this.config.projectId, this.config.testerCode);
|
|
1903
|
+
await this.storage.set(STORAGE_KEY_AUTH, fresh);
|
|
1904
|
+
this.tester = fresh.tester;
|
|
1905
|
+
}
|
|
1906
|
+
this.quietUntilReport = false;
|
|
1907
|
+
void this.refreshAccess().catch(() => void 0);
|
|
1908
|
+
} catch {
|
|
1909
|
+
} finally {
|
|
1910
|
+
this.signingIn = null;
|
|
1911
|
+
}
|
|
1912
|
+
})());
|
|
1913
|
+
return this.signingIn;
|
|
1914
|
+
}
|
|
1885
1915
|
/**
|
|
1886
1916
|
* Drop a login the server no longer accepts, with its session and phone
|
|
1887
1917
|
* state, and log in anonymously again, like a first start. Concurrent
|
|
@@ -1933,6 +1963,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
1933
1963
|
* `revalidate: false` answers from the cache when there is one.
|
|
1934
1964
|
*/
|
|
1935
1965
|
async refreshAccess(options = {}) {
|
|
1966
|
+
if (this.quietUntilReport) return this.accessValue;
|
|
1936
1967
|
const generation = this.accessGeneration;
|
|
1937
1968
|
let status;
|
|
1938
1969
|
try {
|
|
@@ -2006,6 +2037,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
2006
2037
|
*/
|
|
2007
2038
|
async startPhone(phone) {
|
|
2008
2039
|
try {
|
|
2040
|
+
await this.signInForReport();
|
|
2009
2041
|
const r = await this.api.startPhoneVerification(phone);
|
|
2010
2042
|
return { ok: true, verificationId: r.verificationId, devCode: r.devCode };
|
|
2011
2043
|
} catch (e) {
|
|
@@ -2142,7 +2174,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
2142
2174
|
if (!this.sessionId) return Promise.reject(new Error("no session yet"));
|
|
2143
2175
|
payload = { ...payload, sessionId: this.sessionId };
|
|
2144
2176
|
}
|
|
2145
|
-
return this.api.submitBugReport(payload, options);
|
|
2177
|
+
return this.signInForReport().then(() => this.api.submitBugReport(payload, options));
|
|
2146
2178
|
}
|
|
2147
2179
|
});
|
|
2148
2180
|
}
|
|
@@ -2152,6 +2184,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
2152
2184
|
*/
|
|
2153
2185
|
async attachToBugReport(bugReportId, attachment) {
|
|
2154
2186
|
try {
|
|
2187
|
+
await this.signInForReport();
|
|
2155
2188
|
return await this.api.attachToBugReport(bugReportId, attachment);
|
|
2156
2189
|
} catch (e) {
|
|
2157
2190
|
const status = extractStatus2(e);
|
|
@@ -2173,7 +2206,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
2173
2206
|
/** Flush queued attachment uploads immediately. */
|
|
2174
2207
|
async flushAttachmentQueue() {
|
|
2175
2208
|
return this.attachmentQueue.flush({
|
|
2176
|
-
attach: (bugReportId, attachment) => this.api.attachToBugReport(bugReportId, attachment)
|
|
2209
|
+
attach: (bugReportId, attachment) => this.signInForReport().then(() => this.api.attachToBugReport(bugReportId, attachment))
|
|
2177
2210
|
});
|
|
2178
2211
|
}
|
|
2179
2212
|
/** Cached crashes available for post-crash review or retry. */
|
|
@@ -2423,6 +2456,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
2423
2456
|
title: truncate(info.message, 200),
|
|
2424
2457
|
description: composeCrashDescription(info)
|
|
2425
2458
|
});
|
|
2459
|
+
await this.signInForReport();
|
|
2426
2460
|
await this.api.submitBugReport(
|
|
2427
2461
|
{ ...payload, automatic: true },
|
|
2428
2462
|
{ idempotencyKey: crashId }
|
package/dist/index.mjs
CHANGED
|
@@ -1069,7 +1069,7 @@ function findAssignmentForTask(tasks, key) {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
|
|
1071
1071
|
// package.json
|
|
1072
|
-
var version = "2.1.
|
|
1072
|
+
var version = "2.1.1";
|
|
1073
1073
|
|
|
1074
1074
|
// src/version.ts
|
|
1075
1075
|
var SDK_VERSION = `@testerpaykit/expo/${version}`;
|
|
@@ -1274,6 +1274,9 @@ var TpkExpo = class _TpkExpo {
|
|
|
1274
1274
|
this.crashFlush = Promise.resolve();
|
|
1275
1275
|
// ── Access (who sees the widget) ──
|
|
1276
1276
|
this.accessValue = "hidden";
|
|
1277
|
+
/** `syncSessions: false`: nothing reaches the server until a report does. */
|
|
1278
|
+
this.quietUntilReport = false;
|
|
1279
|
+
this.signingIn = null;
|
|
1277
1280
|
this.handleValue = null;
|
|
1278
1281
|
/** Bumped by a tester-gate 403: a check that started before it must
|
|
1279
1282
|
* not bring a stale "ready" back. */
|
|
@@ -1327,6 +1330,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
1327
1330
|
let tester;
|
|
1328
1331
|
let authReady;
|
|
1329
1332
|
let hasCachedAuth = false;
|
|
1333
|
+
const signInLater = config.syncSessions === false && (await storage.get(STORAGE_KEY_PHONE))?.approved !== true;
|
|
1330
1334
|
const acquireFreshAuth = async () => {
|
|
1331
1335
|
try {
|
|
1332
1336
|
const fresh = await api.loginAnonymous(config.projectId, config.testerCode);
|
|
@@ -1342,7 +1346,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
1342
1346
|
authReady = Promise.resolve();
|
|
1343
1347
|
} else {
|
|
1344
1348
|
tester = { id: "", projectId: config.projectId, code: config.testerCode };
|
|
1345
|
-
authReady = acquireFreshAuth();
|
|
1349
|
+
authReady = signInLater ? Promise.resolve() : acquireFreshAuth();
|
|
1346
1350
|
}
|
|
1347
1351
|
let sessionId = "";
|
|
1348
1352
|
let sessionReady;
|
|
@@ -1393,6 +1397,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
1393
1397
|
);
|
|
1394
1398
|
instance.tester = tester;
|
|
1395
1399
|
instance.sessionId = sessionId;
|
|
1400
|
+
instance.quietUntilReport = signInLater;
|
|
1396
1401
|
sessionReady.then(() => {
|
|
1397
1402
|
instance.sessionId = sessionId;
|
|
1398
1403
|
});
|
|
@@ -1446,6 +1451,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
1446
1451
|
const payload = await this.buildPayload(input);
|
|
1447
1452
|
const idempotencyKey = uuidv4();
|
|
1448
1453
|
try {
|
|
1454
|
+
await this.signInForReport();
|
|
1449
1455
|
const response = await this.api.submitBugReport(payload, {
|
|
1450
1456
|
idempotencyKey
|
|
1451
1457
|
});
|
|
@@ -1589,6 +1595,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
1589
1595
|
const cached2 = await this.storage.get(STORAGE_KEY_PHONE);
|
|
1590
1596
|
const cachedOk = cached2?.approved === true;
|
|
1591
1597
|
if (cachedOk && !options.revalidate) return "verified";
|
|
1598
|
+
await this.signInForReport();
|
|
1592
1599
|
let status;
|
|
1593
1600
|
try {
|
|
1594
1601
|
let profile;
|
|
@@ -1616,6 +1623,29 @@ var TpkExpo = class _TpkExpo {
|
|
|
1616
1623
|
}
|
|
1617
1624
|
return status;
|
|
1618
1625
|
}
|
|
1626
|
+
/**
|
|
1627
|
+
* Signs in for the first report when `syncSessions: false` left that open,
|
|
1628
|
+
* or just ends the quiet with a stored login. Concurrent callers share one
|
|
1629
|
+
* sign-in; a failure is retried by the next one.
|
|
1630
|
+
*/
|
|
1631
|
+
signInForReport() {
|
|
1632
|
+
if (!this.quietUntilReport) return Promise.resolve();
|
|
1633
|
+
this.signingIn ?? (this.signingIn = (async () => {
|
|
1634
|
+
try {
|
|
1635
|
+
if (!this.tester.id) {
|
|
1636
|
+
const fresh = await this.api.loginAnonymous(this.config.projectId, this.config.testerCode);
|
|
1637
|
+
await this.storage.set(STORAGE_KEY_AUTH, fresh);
|
|
1638
|
+
this.tester = fresh.tester;
|
|
1639
|
+
}
|
|
1640
|
+
this.quietUntilReport = false;
|
|
1641
|
+
void this.refreshAccess().catch(() => void 0);
|
|
1642
|
+
} catch {
|
|
1643
|
+
} finally {
|
|
1644
|
+
this.signingIn = null;
|
|
1645
|
+
}
|
|
1646
|
+
})());
|
|
1647
|
+
return this.signingIn;
|
|
1648
|
+
}
|
|
1619
1649
|
/**
|
|
1620
1650
|
* Drop a login the server no longer accepts, with its session and phone
|
|
1621
1651
|
* state, and log in anonymously again, like a first start. Concurrent
|
|
@@ -1667,6 +1697,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
1667
1697
|
* `revalidate: false` answers from the cache when there is one.
|
|
1668
1698
|
*/
|
|
1669
1699
|
async refreshAccess(options = {}) {
|
|
1700
|
+
if (this.quietUntilReport) return this.accessValue;
|
|
1670
1701
|
const generation = this.accessGeneration;
|
|
1671
1702
|
let status;
|
|
1672
1703
|
try {
|
|
@@ -1740,6 +1771,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
1740
1771
|
*/
|
|
1741
1772
|
async startPhone(phone) {
|
|
1742
1773
|
try {
|
|
1774
|
+
await this.signInForReport();
|
|
1743
1775
|
const r = await this.api.startPhoneVerification(phone);
|
|
1744
1776
|
return { ok: true, verificationId: r.verificationId, devCode: r.devCode };
|
|
1745
1777
|
} catch (e) {
|
|
@@ -1876,7 +1908,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
1876
1908
|
if (!this.sessionId) return Promise.reject(new Error("no session yet"));
|
|
1877
1909
|
payload = { ...payload, sessionId: this.sessionId };
|
|
1878
1910
|
}
|
|
1879
|
-
return this.api.submitBugReport(payload, options);
|
|
1911
|
+
return this.signInForReport().then(() => this.api.submitBugReport(payload, options));
|
|
1880
1912
|
}
|
|
1881
1913
|
});
|
|
1882
1914
|
}
|
|
@@ -1886,6 +1918,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
1886
1918
|
*/
|
|
1887
1919
|
async attachToBugReport(bugReportId, attachment) {
|
|
1888
1920
|
try {
|
|
1921
|
+
await this.signInForReport();
|
|
1889
1922
|
return await this.api.attachToBugReport(bugReportId, attachment);
|
|
1890
1923
|
} catch (e) {
|
|
1891
1924
|
const status = extractStatus2(e);
|
|
@@ -1907,7 +1940,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
1907
1940
|
/** Flush queued attachment uploads immediately. */
|
|
1908
1941
|
async flushAttachmentQueue() {
|
|
1909
1942
|
return this.attachmentQueue.flush({
|
|
1910
|
-
attach: (bugReportId, attachment) => this.api.attachToBugReport(bugReportId, attachment)
|
|
1943
|
+
attach: (bugReportId, attachment) => this.signInForReport().then(() => this.api.attachToBugReport(bugReportId, attachment))
|
|
1911
1944
|
});
|
|
1912
1945
|
}
|
|
1913
1946
|
/** Cached crashes available for post-crash review or retry. */
|
|
@@ -2157,6 +2190,7 @@ var TpkExpo = class _TpkExpo {
|
|
|
2157
2190
|
title: truncate(info.message, 200),
|
|
2158
2191
|
description: composeCrashDescription(info)
|
|
2159
2192
|
});
|
|
2193
|
+
await this.signInForReport();
|
|
2160
2194
|
await this.api.submitBugReport(
|
|
2161
2195
|
{ ...payload, automatic: true },
|
|
2162
2196
|
{ idempotencyKey: crashId }
|
package/package.json
CHANGED