Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@topher-lo
Copy link
Contributor

@topher-lo topher-lo commented Dec 18, 2025

Summary by cubic

Enable case payloads to be objects or arrays and add a UDF to append or replace payload data. This supports richer ingestion and safer incremental updates.

  • New Features

    • Case payload now accepts object or array in API schemas, DB model (JSONB), and frontend viewer.
    • Added update_payload(case_id, payload, append=false): when append=true, dict+dict merges keys, list+list extends, and dict<->list converts and appends.
  • Migration

    • Regenerate API/client types and update any code that assumed payload is always an object.
    • No backend data migration needed (JSONB unchanged); the UI already renders arrays and hides empty payloads.

Written for commit d33eaf0. Summary will update automatically on new commits.

…oad function

- Modified the payload field in Case model and schemas to accept both dict and list types.
- Implemented update_payload function to allow appending or replacing payload data for existing cases.
- Enhanced frontend to handle payload as either a dictionary or a list.
- Added tests for creating and updating cases with list payloads, ensuring correct behavior for both append and replace scenarios.
@topher-lo topher-lo added api Improvements or additions to the backend API core-actions Improvements to core Tracecat actions labels Dec 18, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 7 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Improvements or additions to the backend API core-actions Improvements to core Tracecat actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants