Skip to content

Streamline segment mutations in the frontend #7819

@khvn26

Description

@khvn26

Move the normal segment edit flow to full-replace semantics. Drop the delete: true convention both from frontend and backend.

Scope

  1. Instead of sending delete: true, the frontend omits removed entries and sends the desired final rules array, as the change-request flow already does via stripIdsAndDeletedFromRulesAndConditions.
  2. Drop the optional id from the SegmentRule and SegmentCondition TypeScript types — the frontend never reads it.
  3. Remove SegmentSerializer._get_rules_and_conditions_without_deleted.

Acceptance criteria

  • Removing a rule or condition in the editor omits it from the request body; no entry carries delete: true.
  • SegmentRule and SegmentCondition types no longer carry id; typecheck passes.
  • Creating, editing, and cloning a segment work against the id-free API.
  • The change-request segment diff renders unchanged.
  • set_segment_rules no longer strips a delete flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiIssue related to the REST APIfront-endIssue related to the React Front End Dashboard

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions