edda-framework 0.15.2__tar.gz → 0.15.3__tar.gz
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.
- {edda_framework-0.15.2 → edda_framework-0.15.3}/PKG-INFO +1 -1
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/storage/sqlalchemy_storage.py +4 -5
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/viewer_ui/components.py +8 -32
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/visualizer/mermaid_generator.py +29 -3
- {edda_framework-0.15.2 → edda_framework-0.15.3}/pyproject.toml +1 -1
- edda_framework-0.15.3/tests/test_mermaid_escape.py +194 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_message_cleanup.py +27 -52
- {edda_framework-0.15.2 → edda_framework-0.15.3}/uv.lock +1 -1
- {edda_framework-0.15.2 → edda_framework-0.15.3}/.github/workflows/ci.yml +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/.github/workflows/docs.yml +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/.github/workflows/release.yml +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/.gitignore +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/.gitmodules +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/.python-version +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/Justfile +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/LICENSE +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/README.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/demo_app.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/api/reference.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/core-features/durable-execution/replay.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/core-features/events/cloudevents-http-binding.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/core-features/events/postgres-notify.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/core-features/events/wait-event.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/core-features/hooks.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/core-features/messages.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/core-features/retry.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/core-features/saga-compensation.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/core-features/transactional-outbox.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/core-features/workflows-activities.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/examples/ecommerce.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/examples/events.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/examples/fastapi-integration.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/examples/saga.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/examples/simple.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/getting-started/concepts.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/getting-started/first-workflow.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/getting-started/installation.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/getting-started/quick-start.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/index.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/integrations/llamaindex.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/integrations/mcp.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/integrations/mirascope.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/integrations/opentelemetry.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/integrations/pydantic-graph.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/integrations/pydantic-rpc.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/viewer-ui/images/cloudevents-cli-trigger.png +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/viewer-ui/images/compensation-execution.png +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/viewer-ui/images/detail-page-loan-approval.png +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/viewer-ui/images/detail-page-match-case.png +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/viewer-ui/images/nested-pydantic-form.png +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/viewer-ui/images/start-workflow-form-pydantic.png +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/viewer-ui/images/wait-event-visualization.png +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/viewer-ui/images/workflow-list-view.png +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/viewer-ui/images/workflow-selection-dropdown.png +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/viewer-ui/setup.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/docs/viewer-ui/visualization.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/activity.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/app.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/channels.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/compensation.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/context.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/exceptions.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/hooks.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/graph/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/graph/context.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/graph/exceptions.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/graph/graph.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/graph/nodes.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/llamaindex/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/llamaindex/events.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/llamaindex/exceptions.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/llamaindex/workflow.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/mcp/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/mcp/decorators.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/mcp/server.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/mirascope/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/mirascope/agent.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/mirascope/call.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/mirascope/decorator.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/mirascope/types.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/opentelemetry/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/integrations/opentelemetry/hooks.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/locking.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/migrations/mysql/20251217000000_initial_schema.sql +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/migrations/postgresql/20251217000000_initial_schema.sql +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/migrations/sqlite/20251217000000_initial_schema.sql +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/outbox/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/outbox/relayer.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/outbox/transactional.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/pydantic_utils.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/replay.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/retry.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/serialization/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/serialization/base.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/serialization/json.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/storage/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/storage/migrations.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/storage/models.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/storage/notify_base.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/storage/pg_notify.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/storage/protocol.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/viewer_app.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/viewer_ui/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/viewer_ui/app.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/viewer_ui/data_service.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/viewer_ui/theme.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/visualizer/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/visualizer/ast_analyzer.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/workflow.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/edda/wsgi.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/cancellable_workflow.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/compensation_workflow.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/event_waiting_app.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/event_waiting_workflow.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/event_waiting_workflow_complete.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/graph/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/graph/demo_graph.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/graph/demo_graph_sleep.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/graph/demo_graph_wait_event.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/llamaindex/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/llamaindex/demo_workflow.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/long_running_loop.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/mcp/README.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/mcp/order_processing_mcp.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/mcp/prompts_example.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/mcp/remote_server_example.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/mcp/simple_mcp_server.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/message_passing.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/mirascope/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/mirascope/durable_agent.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/mirascope/multi_turn.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/mirascope/simple_call.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/mirascope/with_tools.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/observability_with_logfire.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/observability_with_opentelemetry.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/pydantic_rpc_integration.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/pydantic_saga.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/retry_example.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/retry_with_compensation.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/simple_workflow.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/typeddict_example.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/examples/with_outbox.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/schema/.dbmate.yml +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/schema/.git +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/schema/.gitignore +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/schema/LICENSE +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/schema/README.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/schema/docs/column-values.md +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/conftest.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/integrations/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/integrations/mcp/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/integrations/mcp/test_cancel.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/integrations/mcp/test_integration.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/integrations/mcp/test_jsonrpc.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/integrations/mcp/test_prompts.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/integrations/mcp/test_server.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/integrations/mirascope/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/integrations/mirascope/test_agent.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/integrations/mirascope/test_call.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/integrations/mirascope/test_decorator.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/integrations/mirascope/test_types.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/integrations/opentelemetry/__init__.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/integrations/opentelemetry/test_hooks.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_activity.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_activity_retry.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_activity_sync.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_app.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_ast_analyzer.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_atomic_wait_event.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_auto_migration.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_binary_data.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_channel_competing.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_channel_direct.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_channel_mode_locking.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_channel_transactional.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_cloudevents_http_binding.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_compensation.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_compensation_crash_recovery.py.wip +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_concurrent_outbox.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_context.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_cross_language_channel.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_ctx_session.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_distributed_event_delivery.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_events.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_graph_integration.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_instance_id_routing.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_lock_race_condition.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_lock_timeout_customization.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_locking.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_message_delivery_lock.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_messages.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_migrations_integration.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_multidb_storage.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_outbox.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_pg_notify.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_polling_optimization.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_pydantic_activity.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_pydantic_enum.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_pydantic_events.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_pydantic_saga.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_pydantic_utils.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_receive_timeout.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_received_event.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_recur.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_recur_cleanup.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_replay.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_retry_policy.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_saga_parameter_extraction.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_serialization.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_skip_locked.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_stale_workflow_recovery.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_storage.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_storage_mysql.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_storage_postgresql.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_transactions.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_viewer_pagination.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_viewer_pydantic_form.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_viewer_start_saga.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_wait_timer.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_workflow.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_workflow_auto_register.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_workflow_cancellation.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/tests/test_workflow_resumption.py +0 -0
- {edda_framework-0.15.2 → edda_framework-0.15.3}/zensical.toml +0 -0
|
@@ -3673,11 +3673,10 @@ class SQLAlchemyStorage:
|
|
|
3673
3673
|
|
|
3674
3674
|
# Delete old messages
|
|
3675
3675
|
result = await session.execute(
|
|
3676
|
-
delete(ChannelMessage)
|
|
3677
|
-
.where(ChannelMessage.published_at < cutoff_time)
|
|
3678
|
-
.returning(ChannelMessage.id)
|
|
3676
|
+
delete(ChannelMessage).where(ChannelMessage.published_at < cutoff_time)
|
|
3679
3677
|
)
|
|
3680
|
-
deleted_ids = result.fetchall()
|
|
3681
3678
|
await self._commit_if_not_in_transaction(session)
|
|
3682
3679
|
|
|
3683
|
-
|
|
3680
|
+
# MySQL doesn't support DELETE ... RETURNING, so use rowcount.
|
|
3681
|
+
# rowcount is reliable across PostgreSQL/MySQL/SQLite for plain DELETE.
|
|
3682
|
+
return result.rowcount or 0 # type: ignore[attr-defined]
|
|
@@ -7,7 +7,7 @@ from typing import Any
|
|
|
7
7
|
|
|
8
8
|
from edda.viewer_ui.theme import get_edge_color, get_mermaid_node_style, get_mermaid_style
|
|
9
9
|
from edda.visualizer.ast_analyzer import WorkflowAnalyzer
|
|
10
|
-
from edda.visualizer.mermaid_generator import MermaidGenerator
|
|
10
|
+
from edda.visualizer.mermaid_generator import MermaidGenerator, escape_mermaid_label
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
def generate_interactive_mermaid(
|
|
@@ -350,14 +350,16 @@ class HybridMermaidGenerator(MermaidGenerator):
|
|
|
350
350
|
elif step_type == "wait_event":
|
|
351
351
|
# Event waiting
|
|
352
352
|
node_id = self._next_node_id()
|
|
353
|
-
event_type = step.get("event_type", "unknown")
|
|
353
|
+
event_type = escape_mermaid_label(step.get("event_type", "unknown"))
|
|
354
354
|
timeout = step.get("timeout")
|
|
355
355
|
|
|
356
356
|
label = f"wait_event:<br/>{event_type}"
|
|
357
357
|
if timeout:
|
|
358
|
-
label += f"<br/>timeout: {timeout}s"
|
|
358
|
+
label += f"<br/>timeout: {escape_mermaid_label(str(timeout))}s"
|
|
359
359
|
|
|
360
|
-
|
|
360
|
+
# Quoted hexagon form (id{{"label"}}): mermaid 11 rejects bare
|
|
361
|
+
# parens / colons inside unquoted hexagons.
|
|
362
|
+
self.lines.append(f' {node_id}{{{{"{label}"}}}}')
|
|
361
363
|
self.lines.append(f" {current_id} --> {node_id}")
|
|
362
364
|
wait_event_style = get_mermaid_style("waiting_event", self.is_dark)
|
|
363
365
|
self.lines.append(f" style {node_id} {wait_event_style}")
|
|
@@ -406,21 +408,7 @@ class HybridMermaidGenerator(MermaidGenerator):
|
|
|
406
408
|
"""
|
|
407
409
|
# Condition node (diamond shape)
|
|
408
410
|
cond_id = self._next_node_id()
|
|
409
|
-
test_expr = condition.get("test", "condition")
|
|
410
|
-
|
|
411
|
-
# Sanitize test expression for Mermaid - remove ALL problematic characters
|
|
412
|
-
# Replace dict/list accessors and special chars
|
|
413
|
-
test_expr = (
|
|
414
|
-
test_expr.replace('"', "'")
|
|
415
|
-
.replace("{", "(")
|
|
416
|
-
.replace("}", ")")
|
|
417
|
-
.replace("[", ".")
|
|
418
|
-
.replace("]", "")
|
|
419
|
-
.replace("'", "")
|
|
420
|
-
)
|
|
421
|
-
# Limit length to avoid overflow
|
|
422
|
-
if len(test_expr) > 40:
|
|
423
|
-
test_expr = test_expr[:37] + "..."
|
|
411
|
+
test_expr = escape_mermaid_label(condition.get("test", "condition"), max_len=40)
|
|
424
412
|
|
|
425
413
|
# Use diamond shape for condition - correct Mermaid syntax
|
|
426
414
|
self.lines.append(f" {cond_id}{{{test_expr}?}}")
|
|
@@ -777,19 +765,7 @@ class HybridMermaidGenerator(MermaidGenerator):
|
|
|
777
765
|
"""
|
|
778
766
|
# Match node (diamond shape for the subject)
|
|
779
767
|
match_id = self._next_node_id()
|
|
780
|
-
subject = match.get("subject", "value")
|
|
781
|
-
|
|
782
|
-
# Sanitize subject expression for Mermaid
|
|
783
|
-
subject = (
|
|
784
|
-
subject.replace('"', "'")
|
|
785
|
-
.replace("{", "(")
|
|
786
|
-
.replace("}", ")")
|
|
787
|
-
.replace("[", ".")
|
|
788
|
-
.replace("]", "")
|
|
789
|
-
.replace("'", "")
|
|
790
|
-
)
|
|
791
|
-
if len(subject) > 30:
|
|
792
|
-
subject = subject[:27] + "..."
|
|
768
|
+
subject = escape_mermaid_label(match.get("subject", "value"), max_len=30)
|
|
793
769
|
|
|
794
770
|
self.lines.append(f" {match_id}{{{{match {subject}}}}}")
|
|
795
771
|
self.lines.append(f" {prev_id} --> {match_id}")
|
|
@@ -8,6 +8,30 @@ extracted by the AST analyzer.
|
|
|
8
8
|
from typing import Any
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
def escape_mermaid_label(text: str, max_len: int = 60) -> str:
|
|
12
|
+
"""Escape characters that break Mermaid node label syntax.
|
|
13
|
+
|
|
14
|
+
Replaces braces (which clash with hexagon `{{...}}` and diamond `{...}`
|
|
15
|
+
shape syntax), brackets, and quotes. Truncates overly long labels.
|
|
16
|
+
|
|
17
|
+
Used by both the base ``MermaidGenerator`` and the hybrid generator in
|
|
18
|
+
``edda.viewer_ui.components`` to keep AST-extracted argument expressions
|
|
19
|
+
(e.g. f-strings like ``f"workflow.continue:{session_id}"``) safe to embed
|
|
20
|
+
in node labels.
|
|
21
|
+
"""
|
|
22
|
+
text = (
|
|
23
|
+
text.replace('"', "'")
|
|
24
|
+
.replace("{", "(")
|
|
25
|
+
.replace("}", ")")
|
|
26
|
+
.replace("[", ".")
|
|
27
|
+
.replace("]", "")
|
|
28
|
+
.replace("'", "")
|
|
29
|
+
)
|
|
30
|
+
if len(text) > max_len:
|
|
31
|
+
text = text[: max_len - 3] + "..."
|
|
32
|
+
return text
|
|
33
|
+
|
|
34
|
+
|
|
11
35
|
class MermaidGenerator:
|
|
12
36
|
"""
|
|
13
37
|
Generator for Mermaid flowchart diagrams.
|
|
@@ -96,14 +120,16 @@ class MermaidGenerator:
|
|
|
96
120
|
elif step_type == "wait_event":
|
|
97
121
|
# Event waiting
|
|
98
122
|
node_id = self._next_node_id()
|
|
99
|
-
event_type = step.get("event_type", "unknown")
|
|
123
|
+
event_type = escape_mermaid_label(step.get("event_type", "unknown"))
|
|
100
124
|
timeout = step.get("timeout")
|
|
101
125
|
|
|
102
126
|
label = f"wait_event:<br/>{event_type}"
|
|
103
127
|
if timeout:
|
|
104
|
-
label += f"<br/>timeout: {timeout}s"
|
|
128
|
+
label += f"<br/>timeout: {escape_mermaid_label(str(timeout))}s"
|
|
105
129
|
|
|
106
|
-
|
|
130
|
+
# Quoted hexagon form (id{{"label"}}): mermaid 11 rejects bare
|
|
131
|
+
# parens / colons inside unquoted hexagons.
|
|
132
|
+
self.lines.append(f' {node_id}{{{{"{label}"}}}}')
|
|
107
133
|
self.lines.append(f" {current_id} --> {node_id}")
|
|
108
134
|
self.lines.append(f" style {node_id} fill:#fff4e6")
|
|
109
135
|
current_id = node_id
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"""Regression tests for Mermaid label escaping.
|
|
2
|
+
|
|
3
|
+
Covers issue #7: Edda viewer fails when an f-string is used as the
|
|
4
|
+
``event_type`` argument of ``wait_event``. The AST analyzer extracts the
|
|
5
|
+
unparsed source ``f'workflow.continue:{session_id}'`` which contains
|
|
6
|
+
``{`` / ``}`` characters. Without escaping, those characters break the
|
|
7
|
+
Mermaid hexagon node syntax (``id{{label}}``) and the chart fails to
|
|
8
|
+
render.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from edda.viewer_ui.components import HybridMermaidGenerator
|
|
12
|
+
from edda.visualizer.ast_analyzer import WorkflowAnalyzer
|
|
13
|
+
from edda.visualizer.mermaid_generator import MermaidGenerator, escape_mermaid_label
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class TestEscapeMermaidLabel:
|
|
17
|
+
"""Direct tests for the ``escape_mermaid_label`` helper."""
|
|
18
|
+
|
|
19
|
+
def test_replaces_curly_braces(self):
|
|
20
|
+
assert escape_mermaid_label("foo{bar}baz") == "foo(bar)baz"
|
|
21
|
+
|
|
22
|
+
def test_replaces_brackets_and_quotes(self):
|
|
23
|
+
assert escape_mermaid_label('a["b"][c]') == "a.b.c"
|
|
24
|
+
|
|
25
|
+
def test_truncates_long_text(self):
|
|
26
|
+
text = "x" * 100
|
|
27
|
+
out = escape_mermaid_label(text, max_len=20)
|
|
28
|
+
assert len(out) == 20
|
|
29
|
+
assert out.endswith("...")
|
|
30
|
+
|
|
31
|
+
def test_preserves_simple_text(self):
|
|
32
|
+
assert escape_mermaid_label("workflow.continue") == "workflow.continue"
|
|
33
|
+
|
|
34
|
+
def test_handles_fstring_source(self):
|
|
35
|
+
# ast.unparse() of f"workflow.continue:{session_id}" produces this
|
|
36
|
+
unparsed = "f'workflow.continue:{session_id}'"
|
|
37
|
+
out = escape_mermaid_label(unparsed)
|
|
38
|
+
assert "{" not in out
|
|
39
|
+
assert "}" not in out
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class TestAstAnalyzerFstring:
|
|
43
|
+
"""Confirm the AST analyzer returns an f-string source representation
|
|
44
|
+
(containing ``{`` and ``}``) for non-Constant ``event_type`` arguments.
|
|
45
|
+
This documents the input we have to escape downstream."""
|
|
46
|
+
|
|
47
|
+
def test_fstring_event_type_extracted_as_source(self):
|
|
48
|
+
source = '''
|
|
49
|
+
@workflow
|
|
50
|
+
async def fstring_workflow(ctx, session_id: str):
|
|
51
|
+
"""Workflow that waits with an f-string event_type."""
|
|
52
|
+
await wait_event(ctx, event_type=f"workflow.continue:{session_id}")
|
|
53
|
+
'''
|
|
54
|
+
workflows = WorkflowAnalyzer().analyze(source)
|
|
55
|
+
assert len(workflows) == 1
|
|
56
|
+
steps = workflows[0]["steps"]
|
|
57
|
+
wait_steps = [s for s in steps if s.get("type") == "wait_event"]
|
|
58
|
+
assert len(wait_steps) == 1
|
|
59
|
+
|
|
60
|
+
event_type = wait_steps[0]["event_type"]
|
|
61
|
+
# AST analyzer returns the source representation of the f-string,
|
|
62
|
+
# not the runtime-evaluated value.
|
|
63
|
+
assert "{" in event_type
|
|
64
|
+
assert "}" in event_type
|
|
65
|
+
assert "session_id" in event_type
|
|
66
|
+
|
|
67
|
+
def test_constant_event_type_extracted_directly(self):
|
|
68
|
+
source = """
|
|
69
|
+
@workflow
|
|
70
|
+
async def const_workflow(ctx):
|
|
71
|
+
await wait_event(ctx, event_type="workflow.continue")
|
|
72
|
+
"""
|
|
73
|
+
workflows = WorkflowAnalyzer().analyze(source)
|
|
74
|
+
wait_steps = [s for s in workflows[0]["steps"] if s.get("type") == "wait_event"]
|
|
75
|
+
assert wait_steps[0]["event_type"] == "workflow.continue"
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def _wait_event_label_chunks(mermaid: str) -> list[str]:
|
|
79
|
+
"""Extract the label inside hexagon nodes ``id{{...}}`` for inspection."""
|
|
80
|
+
chunks: list[str] = []
|
|
81
|
+
for line in mermaid.splitlines():
|
|
82
|
+
stripped = line.strip()
|
|
83
|
+
# Hexagon syntax: <id>{{<label>}}
|
|
84
|
+
idx = stripped.find("{{")
|
|
85
|
+
end = stripped.rfind("}}")
|
|
86
|
+
if idx != -1 and end != -1 and end > idx:
|
|
87
|
+
chunks.append(stripped[idx + 2 : end])
|
|
88
|
+
return chunks
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
class TestMermaidGeneratorWaitEvent:
|
|
92
|
+
"""Verify ``MermaidGenerator`` (base) escapes f-string event_type."""
|
|
93
|
+
|
|
94
|
+
def test_fstring_event_type_does_not_break_mermaid(self):
|
|
95
|
+
workflow = {
|
|
96
|
+
"name": "fstring_workflow",
|
|
97
|
+
"steps": [
|
|
98
|
+
{
|
|
99
|
+
"type": "wait_event",
|
|
100
|
+
"event_type": "f'workflow.continue:{session_id}'",
|
|
101
|
+
"timeout": None,
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
}
|
|
105
|
+
mermaid = MermaidGenerator().generate(workflow)
|
|
106
|
+
|
|
107
|
+
# No curly braces should leak into the hexagon label region
|
|
108
|
+
for label in _wait_event_label_chunks(mermaid):
|
|
109
|
+
assert "{" not in label, f"unexpected {{ in label: {label!r}"
|
|
110
|
+
assert "}" not in label, f"unexpected }} in label: {label!r}"
|
|
111
|
+
|
|
112
|
+
# The recognizable identifier should still survive (read-only check)
|
|
113
|
+
assert "session_id" in mermaid
|
|
114
|
+
|
|
115
|
+
def test_normal_event_type_renders(self):
|
|
116
|
+
workflow = {
|
|
117
|
+
"name": "normal_workflow",
|
|
118
|
+
"steps": [
|
|
119
|
+
{
|
|
120
|
+
"type": "wait_event",
|
|
121
|
+
"event_type": "payment.completed",
|
|
122
|
+
"timeout": 30,
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
}
|
|
126
|
+
mermaid = MermaidGenerator().generate(workflow)
|
|
127
|
+
assert "wait_event:<br/>payment.completed" in mermaid
|
|
128
|
+
assert "timeout: 30s" in mermaid
|
|
129
|
+
|
|
130
|
+
def test_hexagon_uses_quoted_form(self):
|
|
131
|
+
# Mermaid 11 rejects bare parens / colons in unquoted hexagon labels.
|
|
132
|
+
# The escape helper introduces parens (from { and }), so the hexagon
|
|
133
|
+
# MUST be emitted in quoted form id{{"..."}} or rendering breaks.
|
|
134
|
+
workflow = {
|
|
135
|
+
"name": "any_workflow",
|
|
136
|
+
"steps": [
|
|
137
|
+
{
|
|
138
|
+
"type": "wait_event",
|
|
139
|
+
"event_type": "f'workflow.continue:{session_id}'",
|
|
140
|
+
"timeout": None,
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
}
|
|
144
|
+
mermaid = MermaidGenerator().generate(workflow)
|
|
145
|
+
hexagon_lines = [
|
|
146
|
+
line for line in mermaid.splitlines() if "{{" in line and "wait_event" in line
|
|
147
|
+
]
|
|
148
|
+
assert len(hexagon_lines) == 1
|
|
149
|
+
assert '{{"' in hexagon_lines[0]
|
|
150
|
+
assert '"}}' in hexagon_lines[0]
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
class TestHybridMermaidGeneratorWaitEvent:
|
|
154
|
+
"""Verify ``HybridMermaidGenerator`` (viewer UI) also escapes."""
|
|
155
|
+
|
|
156
|
+
def test_fstring_event_type_does_not_break_mermaid(self):
|
|
157
|
+
workflow = {
|
|
158
|
+
"name": "fstring_workflow",
|
|
159
|
+
"steps": [
|
|
160
|
+
{
|
|
161
|
+
"type": "wait_event",
|
|
162
|
+
"event_type": "f'workflow.continue:{session_id}'",
|
|
163
|
+
"timeout": None,
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
}
|
|
167
|
+
gen = HybridMermaidGenerator(
|
|
168
|
+
instance_id="inst-1",
|
|
169
|
+
executed_activities=set(),
|
|
170
|
+
)
|
|
171
|
+
mermaid = gen.generate(workflow)
|
|
172
|
+
|
|
173
|
+
for label in _wait_event_label_chunks(mermaid):
|
|
174
|
+
assert "{" not in label, f"unexpected {{ in label: {label!r}"
|
|
175
|
+
assert "}" not in label, f"unexpected }} in label: {label!r}"
|
|
176
|
+
|
|
177
|
+
assert "session_id" in mermaid
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
class TestEndToEndWaitEventEscape:
|
|
181
|
+
"""Source code -> AST analyzer -> Mermaid (no broken syntax)."""
|
|
182
|
+
|
|
183
|
+
def test_fstring_workflow_source_to_mermaid_is_valid(self):
|
|
184
|
+
source = """
|
|
185
|
+
@workflow
|
|
186
|
+
async def fstring_workflow(ctx, session_id: str):
|
|
187
|
+
await wait_event(ctx, event_type=f"workflow.continue:{session_id}")
|
|
188
|
+
"""
|
|
189
|
+
workflows = WorkflowAnalyzer().analyze(source)
|
|
190
|
+
mermaid = MermaidGenerator().generate(workflows[0])
|
|
191
|
+
|
|
192
|
+
for label in _wait_event_label_chunks(mermaid):
|
|
193
|
+
assert "{" not in label
|
|
194
|
+
assert "}" not in label
|
|
@@ -6,77 +6,52 @@ import pytest
|
|
|
6
6
|
from sqlalchemy import update
|
|
7
7
|
|
|
8
8
|
from edda.app import EddaApp
|
|
9
|
-
from edda.storage.sqlalchemy_storage import ChannelMessage
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@pytest.fixture
|
|
13
|
-
async def storage():
|
|
14
|
-
"""Create an in-memory SQLite storage for testing."""
|
|
15
|
-
from sqlalchemy.ext.asyncio import create_async_engine
|
|
16
|
-
|
|
17
|
-
engine = create_async_engine("sqlite+aiosqlite:///:memory:", future=True)
|
|
18
|
-
storage = SQLAlchemyStorage(engine)
|
|
19
|
-
await storage.initialize()
|
|
20
|
-
yield storage
|
|
21
|
-
await storage.close()
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@pytest.fixture
|
|
25
|
-
async def app(storage):
|
|
26
|
-
"""Create an EddaApp with the test storage."""
|
|
27
|
-
app = EddaApp(
|
|
28
|
-
service_name="test-service",
|
|
29
|
-
db_url="sqlite+aiosqlite:///:memory:",
|
|
30
|
-
message_retention_days=7,
|
|
31
|
-
)
|
|
32
|
-
# Replace the default storage with our test storage
|
|
33
|
-
app.storage = storage
|
|
34
|
-
yield app
|
|
9
|
+
from edda.storage.sqlalchemy_storage import ChannelMessage
|
|
35
10
|
|
|
36
11
|
|
|
37
12
|
class TestMessageCleanup:
|
|
38
13
|
"""Tests for message cleanup functionality."""
|
|
39
14
|
|
|
40
15
|
@pytest.mark.asyncio
|
|
41
|
-
async def test_cleanup_old_channel_messages_deletes_old_messages(self,
|
|
16
|
+
async def test_cleanup_old_channel_messages_deletes_old_messages(self, db_storage):
|
|
42
17
|
"""Test that messages older than retention period are deleted."""
|
|
43
18
|
# Create an old message (8 days ago)
|
|
44
|
-
await
|
|
19
|
+
await db_storage.publish_to_channel(
|
|
45
20
|
channel="test-channel",
|
|
46
21
|
data={"test": "old message"},
|
|
47
22
|
metadata=None,
|
|
48
23
|
)
|
|
49
24
|
|
|
50
25
|
# Get the message and manually set its published_at to 8 days ago
|
|
51
|
-
async with
|
|
26
|
+
async with db_storage.engine.begin() as conn:
|
|
52
27
|
old_time = datetime.now(UTC) - timedelta(days=8)
|
|
53
28
|
await conn.execute(update(ChannelMessage).values(published_at=old_time))
|
|
54
29
|
|
|
55
30
|
# Create a recent message (today)
|
|
56
|
-
await
|
|
31
|
+
await db_storage.publish_to_channel(
|
|
57
32
|
channel="test-channel",
|
|
58
33
|
data={"test": "new message"},
|
|
59
34
|
metadata=None,
|
|
60
35
|
)
|
|
61
36
|
|
|
62
37
|
# Run cleanup with 7 days retention
|
|
63
|
-
deleted_count = await
|
|
38
|
+
deleted_count = await db_storage.cleanup_old_channel_messages(older_than_days=7)
|
|
64
39
|
|
|
65
40
|
# Should have deleted 1 old message
|
|
66
41
|
assert deleted_count == 1
|
|
67
42
|
|
|
68
43
|
@pytest.mark.asyncio
|
|
69
|
-
async def test_cleanup_old_channel_messages_keeps_recent_messages(self,
|
|
44
|
+
async def test_cleanup_old_channel_messages_keeps_recent_messages(self, db_storage):
|
|
70
45
|
"""Test that messages within retention period are kept."""
|
|
71
46
|
# Create a recent message (today)
|
|
72
|
-
await
|
|
47
|
+
await db_storage.publish_to_channel(
|
|
73
48
|
channel="test-channel",
|
|
74
49
|
data={"test": "recent message"},
|
|
75
50
|
metadata=None,
|
|
76
51
|
)
|
|
77
52
|
|
|
78
53
|
# Run cleanup with 7 days retention
|
|
79
|
-
deleted_count = await
|
|
54
|
+
deleted_count = await db_storage.cleanup_old_channel_messages(older_than_days=7)
|
|
80
55
|
|
|
81
56
|
# Should have deleted 0 messages
|
|
82
57
|
assert deleted_count == 0
|
|
@@ -103,96 +78,96 @@ class TestMessageCleanup:
|
|
|
103
78
|
await app.shutdown()
|
|
104
79
|
|
|
105
80
|
@pytest.mark.asyncio
|
|
106
|
-
async def test_cleanup_multiple_old_messages(self,
|
|
81
|
+
async def test_cleanup_multiple_old_messages(self, db_storage):
|
|
107
82
|
"""Test that multiple old messages are deleted."""
|
|
108
83
|
# Create 3 messages
|
|
109
84
|
for i in range(3):
|
|
110
|
-
await
|
|
85
|
+
await db_storage.publish_to_channel(
|
|
111
86
|
channel="test-channel",
|
|
112
87
|
data={"test": f"message {i}"},
|
|
113
88
|
metadata=None,
|
|
114
89
|
)
|
|
115
90
|
|
|
116
91
|
# Set all messages to be 10 days old
|
|
117
|
-
async with
|
|
92
|
+
async with db_storage.engine.begin() as conn:
|
|
118
93
|
old_time = datetime.now(UTC) - timedelta(days=10)
|
|
119
94
|
await conn.execute(update(ChannelMessage).values(published_at=old_time))
|
|
120
95
|
|
|
121
96
|
# Run cleanup
|
|
122
|
-
deleted_count = await
|
|
97
|
+
deleted_count = await db_storage.cleanup_old_channel_messages(older_than_days=7)
|
|
123
98
|
|
|
124
99
|
# Should have deleted all 3 messages
|
|
125
100
|
assert deleted_count == 3
|
|
126
101
|
|
|
127
102
|
@pytest.mark.asyncio
|
|
128
|
-
async def test_cleanup_with_mixed_ages(self,
|
|
103
|
+
async def test_cleanup_with_mixed_ages(self, db_storage):
|
|
129
104
|
"""Test cleanup with messages of different ages."""
|
|
130
105
|
# Create an old message (8 days old)
|
|
131
|
-
await
|
|
106
|
+
await db_storage.publish_to_channel(
|
|
132
107
|
channel="test-channel",
|
|
133
108
|
data={"test": "old message 1"},
|
|
134
109
|
metadata=None,
|
|
135
110
|
)
|
|
136
111
|
|
|
137
112
|
# Set this message to be old
|
|
138
|
-
async with
|
|
113
|
+
async with db_storage.engine.begin() as conn:
|
|
139
114
|
old_time = datetime.now(UTC) - timedelta(days=8)
|
|
140
115
|
await conn.execute(
|
|
141
116
|
update(ChannelMessage).where(ChannelMessage.id == 1).values(published_at=old_time)
|
|
142
117
|
)
|
|
143
118
|
|
|
144
119
|
# Create another old message (10 days old)
|
|
145
|
-
await
|
|
120
|
+
await db_storage.publish_to_channel(
|
|
146
121
|
channel="test-channel",
|
|
147
122
|
data={"test": "old message 2"},
|
|
148
123
|
metadata=None,
|
|
149
124
|
)
|
|
150
125
|
|
|
151
126
|
# Set this message to be older
|
|
152
|
-
async with
|
|
127
|
+
async with db_storage.engine.begin() as conn:
|
|
153
128
|
older_time = datetime.now(UTC) - timedelta(days=10)
|
|
154
129
|
await conn.execute(
|
|
155
130
|
update(ChannelMessage).where(ChannelMessage.id == 2).values(published_at=older_time)
|
|
156
131
|
)
|
|
157
132
|
|
|
158
133
|
# Create a recent message (today)
|
|
159
|
-
await
|
|
134
|
+
await db_storage.publish_to_channel(
|
|
160
135
|
channel="test-channel",
|
|
161
136
|
data={"test": "new message"},
|
|
162
137
|
metadata=None,
|
|
163
138
|
)
|
|
164
139
|
|
|
165
140
|
# Run cleanup with 7 days retention
|
|
166
|
-
deleted_count = await
|
|
141
|
+
deleted_count = await db_storage.cleanup_old_channel_messages(older_than_days=7)
|
|
167
142
|
|
|
168
143
|
# Should have deleted 2 old messages
|
|
169
144
|
assert deleted_count == 2
|
|
170
145
|
|
|
171
146
|
@pytest.mark.asyncio
|
|
172
|
-
async def test_cleanup_with_custom_retention_period(self,
|
|
147
|
+
async def test_cleanup_with_custom_retention_period(self, db_storage):
|
|
173
148
|
"""Test cleanup with custom retention period."""
|
|
174
149
|
# Create a message that is 3 days old
|
|
175
|
-
await
|
|
150
|
+
await db_storage.publish_to_channel(
|
|
176
151
|
channel="test-channel",
|
|
177
152
|
data={"test": "message"},
|
|
178
153
|
metadata=None,
|
|
179
154
|
)
|
|
180
155
|
|
|
181
156
|
# Set message to be 3 days old
|
|
182
|
-
async with
|
|
157
|
+
async with db_storage.engine.begin() as conn:
|
|
183
158
|
old_time = datetime.now(UTC) - timedelta(days=3)
|
|
184
159
|
await conn.execute(update(ChannelMessage).values(published_at=old_time))
|
|
185
160
|
|
|
186
161
|
# With 7 days retention, should NOT be deleted
|
|
187
|
-
deleted_count = await
|
|
162
|
+
deleted_count = await db_storage.cleanup_old_channel_messages(older_than_days=7)
|
|
188
163
|
assert deleted_count == 0
|
|
189
164
|
|
|
190
165
|
# With 2 days retention, SHOULD be deleted
|
|
191
|
-
deleted_count = await
|
|
166
|
+
deleted_count = await db_storage.cleanup_old_channel_messages(older_than_days=2)
|
|
192
167
|
assert deleted_count == 1
|
|
193
168
|
|
|
194
169
|
@pytest.mark.asyncio
|
|
195
|
-
async def test_cleanup_empty_database(self,
|
|
170
|
+
async def test_cleanup_empty_database(self, db_storage):
|
|
196
171
|
"""Test cleanup when there are no messages."""
|
|
197
|
-
deleted_count = await
|
|
172
|
+
deleted_count = await db_storage.cleanup_old_channel_messages(older_than_days=7)
|
|
198
173
|
assert deleted_count == 0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{edda_framework-0.15.2 → edda_framework-0.15.3}/docs/core-features/durable-execution/replay.md
RENAMED
|
File without changes
|
|
File without changes
|
{edda_framework-0.15.2 → edda_framework-0.15.3}/docs/core-features/events/postgres-notify.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|