|
|
|
|
@ -237,6 +237,43 @@ $insert(8000, [
|
|
|
|
|
'finalization_error_code' => null,
|
|
|
|
|
'available_at' => 0,
|
|
|
|
|
]);
|
|
|
|
|
$insert(8001, [
|
|
|
|
|
'kind' => 'payment_create',
|
|
|
|
|
'execution_mode' => 'local',
|
|
|
|
|
'instance_id' => null,
|
|
|
|
|
'host_id' => null,
|
|
|
|
|
'phase' => 'accepted',
|
|
|
|
|
'outcome' => null,
|
|
|
|
|
'status' => 'queued',
|
|
|
|
|
'attempts' => 0,
|
|
|
|
|
'dispatch_attempts' => 0,
|
|
|
|
|
'dispatch_deadline_at' => $now + 300,
|
|
|
|
|
'dispatch_started_at' => null,
|
|
|
|
|
'agent_accepted_at' => null,
|
|
|
|
|
'dispatched_at' => null,
|
|
|
|
|
'receipt_deadline_at' => null,
|
|
|
|
|
'terminal_at' => null,
|
|
|
|
|
'effect_may_have_applied' => null,
|
|
|
|
|
'safe_to_resubmit' => null,
|
|
|
|
|
'effect_resolution' => 'not_applicable',
|
|
|
|
|
'finalization_incident' => 0,
|
|
|
|
|
'finalization_error_code' => null,
|
|
|
|
|
'available_at' => $now,
|
|
|
|
|
]);
|
|
|
|
|
$insert(8002, [
|
|
|
|
|
'kind' => 'payment_create',
|
|
|
|
|
'execution_mode' => 'local',
|
|
|
|
|
'instance_id' => null,
|
|
|
|
|
'host_id' => null,
|
|
|
|
|
'outcome' => 'succeeded',
|
|
|
|
|
'status' => 'succeeded',
|
|
|
|
|
'effect_may_have_applied' => 0,
|
|
|
|
|
'safe_to_resubmit' => 0,
|
|
|
|
|
'effect_resolution' => 'applied',
|
|
|
|
|
'finalization_incident' => 0,
|
|
|
|
|
'finalization_error_code' => null,
|
|
|
|
|
'available_at' => 0,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$tasks = CloudJobService::tasks(['user_id' => 7, 'is_admin' => false],
|
|
|
|
|
'completed');
|
|
|
|
|
@ -244,9 +281,18 @@ $assert(($tasks['active_count'] ?? null) === 1,
|
|
|
|
|
'Task center active count changed while adding recovery polling.');
|
|
|
|
|
$assert(($tasks['recovering_count'] ?? null) === 2,
|
|
|
|
|
'Task center did not count visible terminal tasks that still converge.');
|
|
|
|
|
$assert(($tasks['unread_count'] ?? null) === 4,
|
|
|
|
|
'A hidden payment task changed the task-center unread badge.');
|
|
|
|
|
$assert(array_map(static fn (array $item): string => $item['id'],
|
|
|
|
|
$tasks['items']) === ['5', '3', '2', '1'],
|
|
|
|
|
'Task center exposed hidden child work or changed terminal ordering.');
|
|
|
|
|
'Task center exposed hidden child or payment work, or changed terminal ordering.');
|
|
|
|
|
$paymentReceipt = CloudJobService::display(
|
|
|
|
|
\App\Models\CloudJob::findOrFail(8002),
|
|
|
|
|
false
|
|
|
|
|
);
|
|
|
|
|
$assert(($paymentReceipt['id'] ?? null) === '8002'
|
|
|
|
|
&& ($paymentReceipt['completed'] ?? null) === true,
|
|
|
|
|
'Hiding payment work from the drawer also broke direct receipt polling.');
|
|
|
|
|
$assert(($tasks['items'][0]['recovery']['pending'] ?? null) === true
|
|
|
|
|
&& ($tasks['items'][3]['recovery']['pending'] ?? null) === true
|
|
|
|
|
&& !isset($tasks['items'][1]['recovery'])
|
|
|
|
|
|