mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-10 01:56:16 -08:00
fix(stalker): narrow collection attempt references
This commit is contained in:
1 parent
3129d22a71
commit
bc849a7c18
1 file changed
+8
-4
@@ -438,6 +438,10 @@ export class StreamResolverService {
|
||||
await this.discardStalkerAttempt(outcome);
|
||||
throw new StalkerSessionOutcomeError(outcome);
|
||||
}
|
||||
const attemptRef = outcome.attemptRef;
|
||||
if (attemptRef === undefined) {
|
||||
throw new Error('stalker-session-attempt-missing');
|
||||
}
|
||||
|
||||
const draft: Playlist = {
|
||||
...playlist,
|
||||
@@ -460,7 +464,7 @@ export class StreamResolverService {
|
||||
);
|
||||
} catch (error) {
|
||||
await this.stalkerSession
|
||||
.discard(outcome.attemptRef)
|
||||
.discard(attemptRef)
|
||||
.catch(() => undefined);
|
||||
throw error;
|
||||
}
|
||||
@@ -472,16 +476,16 @@ export class StreamResolverService {
|
||||
|
||||
let promotion;
|
||||
try {
|
||||
promotion = await this.stalkerSession.commit(outcome.attemptRef);
|
||||
promotion = await this.stalkerSession.commit(attemptRef);
|
||||
} catch {
|
||||
await this.stalkerSession
|
||||
.discard(outcome.attemptRef)
|
||||
.discard(attemptRef)
|
||||
.catch(() => undefined);
|
||||
throw new Error('stalker-session-promotion-failed');
|
||||
}
|
||||
if (promotion.kind !== 'success') {
|
||||
await this.stalkerSession
|
||||
.discard(outcome.attemptRef)
|
||||
.discard(attemptRef)
|
||||
.catch(() => undefined);
|
||||
throw new Error('stalker-session-promotion-failed');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user