summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/common.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-02-19 21:13:00 +0100
committerFlorian Dold <florian@dold.me>2024-02-19 21:13:00 +0100
commit862ac9a16aa891c26355f9ad5858283c3aa029d6 (patch)
treef8b4244463a8bba73e277a6113fe306b3a3658a7 /packages/taler-wallet-core/src/common.ts
parent20397e3fba3fe4b274354047f76e3a8f3a92d6b8 (diff)
downloadwallet-core-862ac9a16aa891c26355f9ad5858283c3aa029d6.tar.gz
wallet-core-862ac9a16aa891c26355f9ad5858283c3aa029d6.tar.bz2
wallet-core-862ac9a16aa891c26355f9ad5858283c3aa029d6.zip
wallet-core: safer long-polling
We now wait for some time if long-polling returns too early
Diffstat (limited to 'packages/taler-wallet-core/src/common.ts')
-rw-r--r--packages/taler-wallet-core/src/common.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/common.ts b/packages/taler-wallet-core/src/common.ts
index 9d7f2e763..45351f680 100644
--- a/packages/taler-wallet-core/src/common.ts
+++ b/packages/taler-wallet-core/src/common.ts
@@ -350,6 +350,7 @@ export enum TaskRunResultType {
Backoff = "backoff",
Progress = "progress",
Error = "error",
+ LongpollReturnedPending = "longpoll-returned-pending",
ScheduleLater = "schedule-later",
}
@@ -358,6 +359,7 @@ export type TaskRunResult =
| TaskRunErrorResult
| TaskRunBackoffResult
| TaskRunProgressResult
+ | TaskRunLongpollReturnedPendingResult
| TaskRunScheduleLaterResult;
export namespace TaskRunResult {
@@ -396,6 +398,15 @@ export namespace TaskRunResult {
runAt,
};
}
+ /**
+ * Longpolling returned, but what we're waiting for
+ * is still pending on the other side.
+ */
+ export function longpollReturnedPending(): TaskRunLongpollReturnedPendingResult {
+ return {
+ type: TaskRunResultType.LongpollReturnedPending,
+ };
+ }
}
export interface TaskRunFinishedResult {
@@ -415,6 +426,10 @@ export interface TaskRunScheduleLaterResult {
runAt: AbsoluteTime;
}
+export interface TaskRunLongpollReturnedPendingResult {
+ type: TaskRunResultType.LongpollReturnedPending;
+}
+
export interface TaskRunErrorResult {
type: TaskRunResultType.Error;
errorDetail: TalerErrorDetail;