@sparkvault/sdk-js 8.8.1 → 8.8.2
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/dist/products/identity/dialog-launcher.d.ts +10 -0
- package/dist/sparkvault.cjs.js +11 -1
- package/dist/sparkvault.cjs.js.map +1 -1
- package/dist/sparkvault.esm.js +11 -1
- package/dist/sparkvault.esm.js.map +1 -1
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/package.json +1 -1
|
@@ -28,6 +28,16 @@ interface LauncherCallbacks {
|
|
|
28
28
|
onSuccess: (result: VerifyResult) => void;
|
|
29
29
|
onError: (error: Error) => void;
|
|
30
30
|
onCancel: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* The opener OBSERVED the popup end with no result (window closed, or it
|
|
33
|
+
* never opened) while the retry alert keeps the flow alive. There is no lost
|
|
34
|
+
* result to self-heal, so the owner retires its pending sign-in marker —
|
|
35
|
+
* without this, a reload while the alert is up fires a spurious recovery
|
|
36
|
+
* bounce. Deliberately NOT onCancel: the flow is unsettled, retry may follow.
|
|
37
|
+
*/
|
|
38
|
+
onPopupClosedUnresolved?: () => void;
|
|
39
|
+
/** "Try again" opened a fresh popup: a sign-in is in flight again, re-arm. */
|
|
40
|
+
onPopupReopened?: () => void;
|
|
31
41
|
}
|
|
32
42
|
/**
|
|
33
43
|
* Opens the sign-in popup for dialog-mode `verify()` and bridges its result
|
package/dist/sparkvault.cjs.js
CHANGED
|
@@ -7966,8 +7966,12 @@ class DialogLauncher {
|
|
|
7966
7966
|
if (this.settled)
|
|
7967
7967
|
return;
|
|
7968
7968
|
// Blocked (never opened) or closed (gone) - the popup can't be confirmed,
|
|
7969
|
-
// so surface the warning so the user can reopen it.
|
|
7969
|
+
// so surface the warning so the user can reopen it. Either way the opener
|
|
7970
|
+
// observed the end with no result, so there is nothing for the next-load
|
|
7971
|
+
// self-heal to recover (a late success message still wins: this branch
|
|
7972
|
+
// leaves the flow unsettled, and onSuccess re-clears regardless).
|
|
7970
7973
|
if (error instanceof PopupBlockedError || error instanceof UserCancelledError) {
|
|
7974
|
+
this.callbacks.onPopupClosedUnresolved?.();
|
|
7971
7975
|
this.showAlert();
|
|
7972
7976
|
return;
|
|
7973
7977
|
}
|
|
@@ -8022,6 +8026,7 @@ class DialogLauncher {
|
|
|
8022
8026
|
}
|
|
8023
8027
|
/** "Try again": close any current popup and reopen a fresh one. */
|
|
8024
8028
|
retry() {
|
|
8029
|
+
this.callbacks.onPopupReopened?.();
|
|
8025
8030
|
this.hideAlert();
|
|
8026
8031
|
this.closePopup();
|
|
8027
8032
|
this.openPopup();
|
|
@@ -8664,6 +8669,11 @@ class IdentityModule {
|
|
|
8664
8669
|
onSuccess: (result) => { this.clearSignInPending(); hostCallbacks.onSuccess(result); },
|
|
8665
8670
|
onError: (error) => { this.clearSignInPending(); hostCallbacks.onError(error); },
|
|
8666
8671
|
onCancel: () => { this.clearSignInPending(); hostCallbacks.onCancel(); },
|
|
8672
|
+
// Self-heal exists for a result the opener never observed. An observed
|
|
8673
|
+
// no-result end retires the marker (no spurious bounce on a reload
|
|
8674
|
+
// while the retry alert is up); "Try again" re-arms it.
|
|
8675
|
+
onPopupClosedUnresolved: () => this.clearSignInPending(),
|
|
8676
|
+
onPopupReopened: () => this.markSignInPending(),
|
|
8667
8677
|
});
|
|
8668
8678
|
this.launcher.start();
|
|
8669
8679
|
return settledPromise;
|