@pushary/agent-hooks 0.64.4 → 0.66.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.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.66.0
|
|
4
|
+
|
|
5
|
+
### Setup waited three minutes for a step that takes longer than three minutes
|
|
6
|
+
|
|
7
|
+
If you already had the app installed and signed in, pairing resolved in seconds
|
|
8
|
+
and this never came up. If you did not, it could not work at all.
|
|
9
|
+
|
|
10
|
+
Scanning the QR without the app opens a page that sends you to the store. Install
|
|
11
|
+
it, sign in, subscribe, come back, scan: that is never three minutes. The CLI had
|
|
12
|
+
given up and cancelled the pairing long before, so a first-time user's first scan
|
|
13
|
+
was guaranteed to fail, and the only route through was to notice the terminal had
|
|
14
|
+
stopped waiting and run setup again.
|
|
15
|
+
|
|
16
|
+
Setup now waits as long as the code is actually valid, and after the first
|
|
17
|
+
45 seconds the spinner says what to do if the app is not installed yet. Ctrl-C
|
|
18
|
+
still exits cleanly and cancels the pairing, so nothing holds you there.
|
|
19
|
+
|
|
20
|
+
The window itself is unchanged in what protects it: a pairing id is 128 bits,
|
|
21
|
+
single use, deleted the moment it is claimed, and authorising one requires a
|
|
22
|
+
signed-in session for the owning account and the public key you physically
|
|
23
|
+
scanned.
|
|
24
|
+
|
|
25
|
+
## 0.65.0
|
|
26
|
+
|
|
27
|
+
### The pairing QR now works when you scan it with your phone camera
|
|
28
|
+
|
|
29
|
+
It did not. Scanning it opened the app on "Unmatched Route", and the only way
|
|
30
|
+
through was the in-app scanner, which parses the QR itself and never routes.
|
|
31
|
+
|
|
32
|
+
The QR encoded `https://pushary.com/app/pair`, and `/app/*` is claimed by the
|
|
33
|
+
app: the AASA lists it and so does the Android manifest. The OS therefore handed
|
|
34
|
+
the link to the app before the page could load, which was the intent. What it
|
|
35
|
+
handed over was the path `/app/pair`, and the app's pairing screen is `/pair`.
|
|
36
|
+
Nothing matched, on every build ever shipped.
|
|
37
|
+
|
|
38
|
+
The QR points at `/pair` now. Nothing claims it, so the browser always opens it,
|
|
39
|
+
and the page hands off to `pushary://pair`, which every shipped build already
|
|
40
|
+
routes correctly. That is the whole reason for the move: the Android claim is
|
|
41
|
+
compiled into the installed app, so no amount of server or app-store work fixes
|
|
42
|
+
the phones already out there, and this does, today.
|
|
43
|
+
|
|
44
|
+
`/app/pair` still serves the same page, so a link from an older CLI is not dead.
|
|
45
|
+
|
|
3
46
|
## 0.64.4
|
|
4
47
|
|
|
5
48
|
### The shell you ran setup in still exported the key it replaced
|
|
@@ -448,7 +448,8 @@ var printConnectInstructions = async (apiKey) => {
|
|
|
448
448
|
return phoneFailure("no_device");
|
|
449
449
|
};
|
|
450
450
|
var PAIR_POLL_INTERVAL_MS = 2e3;
|
|
451
|
-
var PAIR_TIMEOUT_MS =
|
|
451
|
+
var PAIR_TIMEOUT_MS = 9e5;
|
|
452
|
+
var PAIR_HINT_AFTER_MS = 45e3;
|
|
452
453
|
var startPairing = async (cliPublicKey) => {
|
|
453
454
|
try {
|
|
454
455
|
const res = await fetch(`${apiBase()}/api/mobile/pair/start`, {
|
|
@@ -490,7 +491,7 @@ var buildPairLinks = (pairId, publicKeyB64, baseUrl = apiBase()) => {
|
|
|
490
491
|
const id = encodeURIComponent(pairId);
|
|
491
492
|
const pk = encodeURIComponent(publicKeyB64);
|
|
492
493
|
return {
|
|
493
|
-
universalLink: `${baseUrl.replace(/\/+$/, "")}/
|
|
494
|
+
universalLink: `${baseUrl.replace(/\/+$/, "")}/pair?id=${id}&pk=${pk}`,
|
|
494
495
|
deepLink: `pushary://pair?pk=${pk}&id=${id}`
|
|
495
496
|
};
|
|
496
497
|
};
|
|
@@ -511,10 +512,14 @@ var connectViaAppPairing = async (options = {}) => {
|
|
|
511
512
|
console.log(` ${dim("Confirm the app shows fingerprint")} ${cyan(publicKeyFingerprint(keypair.publicKeyB64))}`);
|
|
512
513
|
console.log(` ${dim("Already have the app and it opened a browser? Use")} ${cyan(deepLink)}`);
|
|
513
514
|
console.log();
|
|
514
|
-
const
|
|
515
|
+
const startedAt = Date.now();
|
|
516
|
+
const deadline = startedAt + PAIR_TIMEOUT_MS;
|
|
515
517
|
const stop = startSpinner(() => {
|
|
516
|
-
const left = Math.max(0, Math.ceil((deadline - Date.now()) /
|
|
517
|
-
|
|
518
|
+
const left = Math.max(0, Math.ceil((deadline - Date.now()) / 6e4));
|
|
519
|
+
if (Date.now() - startedAt < PAIR_HINT_AFTER_MS) {
|
|
520
|
+
return "Waiting for the app to authorize";
|
|
521
|
+
}
|
|
522
|
+
return `Waiting for the app ${dim(`(${left}m left. No app yet? Install it, sign in with this account, then scan. Ctrl-C to stop)`)}`;
|
|
518
523
|
});
|
|
519
524
|
let cancelled = false;
|
|
520
525
|
const onInterrupt = () => {
|