@windyroad/voice-tone 0.9.4-preview.1270 → 0.9.5-preview.1278
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.
|
@@ -286,7 +286,7 @@ function registrations(input, target) {
|
|
|
286
286
|
const path = join(transportDir(), name);
|
|
287
287
|
try {
|
|
288
288
|
const registered = JSON.parse(readFileSync(path, "utf8"));
|
|
289
|
-
return registered.role === role &&
|
|
289
|
+
return registered.role === role &&
|
|
290
290
|
registered.root === current.root && registered.physical === current.physical
|
|
291
291
|
? [{ path, registered, age: Date.now() - Math.floor(statSync(path).mtimeMs) }]
|
|
292
292
|
: [];
|
|
@@ -297,12 +297,15 @@ function registrations(input, target) {
|
|
|
297
297
|
function persistPending(input, target, output) {
|
|
298
298
|
target = normalizeTarget(target);
|
|
299
299
|
if (!target || typeof output !== "string" || !output) return;
|
|
300
|
-
const
|
|
300
|
+
const registrationsForCheckout = registrations(input, target);
|
|
301
|
+
const exact = registrationsForCheckout.filter(({ registered }) => registered.target === target);
|
|
302
|
+
const candidates = exact.length ? exact : registrationsForCheckout.filter(({ registered }) => registered.parentSession === input.session_id);
|
|
301
303
|
if (candidates.length !== 1) {
|
|
302
304
|
diagnostic(candidates.length ? "ambiguous-parent-registration" : "missing-parent-registration", input);
|
|
303
305
|
return;
|
|
304
306
|
}
|
|
305
307
|
const { registered, age } = candidates[0];
|
|
308
|
+
target = registered.target;
|
|
306
309
|
if (!validRegistration(registered, input, target, age)) return;
|
|
307
310
|
if (!outputAllowed(output, registered)) {
|
|
308
311
|
diagnostic("non-pass-or-mismatched-output", input);
|
|
@@ -286,7 +286,7 @@ function registrations(input, target) {
|
|
|
286
286
|
const path = join(transportDir(), name);
|
|
287
287
|
try {
|
|
288
288
|
const registered = JSON.parse(readFileSync(path, "utf8"));
|
|
289
|
-
return registered.role === role &&
|
|
289
|
+
return registered.role === role &&
|
|
290
290
|
registered.root === current.root && registered.physical === current.physical
|
|
291
291
|
? [{ path, registered, age: Date.now() - Math.floor(statSync(path).mtimeMs) }]
|
|
292
292
|
: [];
|
|
@@ -297,12 +297,15 @@ function registrations(input, target) {
|
|
|
297
297
|
function persistPending(input, target, output) {
|
|
298
298
|
target = normalizeTarget(target);
|
|
299
299
|
if (!target || typeof output !== "string" || !output) return;
|
|
300
|
-
const
|
|
300
|
+
const registrationsForCheckout = registrations(input, target);
|
|
301
|
+
const exact = registrationsForCheckout.filter(({ registered }) => registered.target === target);
|
|
302
|
+
const candidates = exact.length ? exact : registrationsForCheckout.filter(({ registered }) => registered.parentSession === input.session_id);
|
|
301
303
|
if (candidates.length !== 1) {
|
|
302
304
|
diagnostic(candidates.length ? "ambiguous-parent-registration" : "missing-parent-registration", input);
|
|
303
305
|
return;
|
|
304
306
|
}
|
|
305
307
|
const { registered, age } = candidates[0];
|
|
308
|
+
target = registered.target;
|
|
306
309
|
if (!validRegistration(registered, input, target, age)) return;
|
|
307
310
|
if (!outputAllowed(output, registered)) {
|
|
308
311
|
diagnostic("non-pass-or-mismatched-output", input);
|