@@ -1518,6 +1518,110 @@ public function testShowUsesConfiguredSummaryAndHistoryModels(): void
15181518 ->assertJsonPath ('workflow_definition_fingerprint ' , 'configured-waterline-fingerprint ' );
15191519 }
15201520
1521+ public function testShowUsesConfiguredSummaryAndHistoryModelsWhenTypedMemosAreMissing (): void
1522+ {
1523+ config ()->set ('waterline.engine_source ' , 'v2 ' );
1524+ config ()->set ('workflows.v2.run_summary_model ' , ConfiguredWaterlineDetailRunSummary::class);
1525+ config ()->set ('workflows.v2.history_event_model ' , ConfiguredWaterlineDetailHistoryEvent::class);
1526+
1527+ $ this ->createConfiguredDetailSummaryTable ();
1528+ $ this ->createConfiguredDetailHistoryTable ();
1529+
1530+ $ instance = WorkflowInstance::create ([
1531+ 'id ' => 'configured-waterline-detail-instance-no-typed-memo ' ,
1532+ 'workflow_class ' => 'Missing \\ConfiguredWaterlineWorkflow ' ,
1533+ 'workflow_type ' => 'configured.waterline.workflow ' ,
1534+ 'memo ' => [
1535+ 'customer ' => [
1536+ 'name ' => 'Taylor ' ,
1537+ ],
1538+ ],
1539+ 'run_count ' => 1 ,
1540+ ]);
1541+
1542+ $ run = WorkflowRun::create ([
1543+ 'id ' => '01JTESTWATERLINECONFIG0002 ' ,
1544+ 'workflow_instance_id ' => $ instance ->id ,
1545+ 'run_number ' => 1 ,
1546+ 'workflow_class ' => 'Missing \\ConfiguredWaterlineWorkflow ' ,
1547+ 'workflow_type ' => 'configured.waterline.workflow ' ,
1548+ 'status ' => RunStatus::Waiting->value ,
1549+ 'memo ' => [
1550+ 'customer ' => [
1551+ 'name ' => 'Taylor ' ,
1552+ ],
1553+ 'order ' => [
1554+ 'id ' => 123 ,
1555+ ],
1556+ ],
1557+ 'search_attributes ' => [
1558+ 'customer_tier ' => 'gold ' ,
1559+ ],
1560+ 'arguments ' => Serializer::serialize ([]),
1561+ 'connection ' => 'redis ' ,
1562+ 'queue ' => 'default ' ,
1563+ 'started_at ' => now ()->subMinutes (2 ),
1564+ 'last_progress_at ' => now ()->subMinute (),
1565+ ]);
1566+
1567+ $ instance ->update (['current_run_id ' => $ run ->id ]);
1568+
1569+ ConfiguredWaterlineDetailRunSummary::create ([
1570+ 'id ' => $ run ->id ,
1571+ 'workflow_instance_id ' => $ instance ->id ,
1572+ 'run_number ' => 1 ,
1573+ 'is_current_run ' => true ,
1574+ 'engine_source ' => 'v2 ' ,
1575+ 'class ' => 'Missing \\ConfiguredWaterlineWorkflow ' ,
1576+ 'workflow_type ' => 'configured.waterline.workflow ' ,
1577+ 'business_key ' => 'configured-waterline-business ' ,
1578+ 'status ' => RunStatus::Waiting->value ,
1579+ 'status_bucket ' => 'running ' ,
1580+ 'started_at ' => $ run ->started_at ,
1581+ 'history_event_count ' => 1 ,
1582+ 'history_size_bytes ' => 128 ,
1583+ 'continue_as_new_recommended ' => false ,
1584+ 'sort_timestamp ' => $ run ->started_at ,
1585+ 'sort_key ' => 'configured-waterline-sort-key ' ,
1586+ 'created_at ' => $ run ->started_at ,
1587+ 'updated_at ' => $ run ->last_progress_at ,
1588+ ]);
1589+
1590+ ConfiguredWaterlineDetailHistoryEvent::create ([
1591+ 'id ' => (string ) Str::ulid (),
1592+ 'workflow_run_id ' => $ run ->id ,
1593+ 'sequence ' => 1 ,
1594+ 'event_type ' => HistoryEventType::WorkflowStarted->value ,
1595+ 'payload ' => [
1596+ 'workflow_class ' => 'Missing \\ConfiguredWaterlineWorkflow ' ,
1597+ 'workflow_type ' => 'configured.waterline.workflow ' ,
1598+ 'workflow_definition_fingerprint ' => 'configured-waterline-fingerprint ' ,
1599+ 'declared_queries ' => [],
1600+ 'declared_query_contracts ' => [],
1601+ 'declared_signals ' => ['configured-waterline-signal ' ],
1602+ 'declared_signal_contracts ' => [],
1603+ 'declared_updates ' => [],
1604+ 'declared_update_contracts ' => [],
1605+ 'declared_entry_method ' => 'handle ' ,
1606+ 'declared_entry_mode ' => 'canonical ' ,
1607+ 'declared_entry_declaring_class ' => 'Missing \\ConfiguredWaterlineWorkflow ' ,
1608+ ],
1609+ 'recorded_at ' => $ run ->started_at ,
1610+ ]);
1611+
1612+ $ this ->assertSame (0 , WorkflowMemo::query ()->count ());
1613+ $ this ->get ('/waterline/api/flows/ ' . $ run ->id )
1614+ ->assertOk ()
1615+ ->assertJsonPath ('status_bucket ' , 'running ' )
1616+ ->assertJsonPath ('business_key ' , 'configured-waterline-business ' )
1617+ ->assertJsonPath ('memo.customer.name ' , 'Taylor ' )
1618+ ->assertJsonPath ('memo.order.id ' , 123 )
1619+ ->assertJsonPath ('search_attributes.customer_tier ' , 'gold ' )
1620+ ->assertJsonPath ('declared_contract_source ' , 'durable_history ' )
1621+ ->assertJsonPath ('declared_signals.0 ' , 'configured-waterline-signal ' )
1622+ ->assertJsonPath ('workflow_definition_fingerprint ' , 'configured-waterline-fingerprint ' );
1623+ }
1624+
15211625 public function testShowRebuildsTimelineProjectionRowsOnRead (): void
15221626 {
15231627 config ()->set ('waterline.engine_source ' , 'v2 ' );
0 commit comments