Skip to content

Conversation

@loewenheim
Copy link
Contributor

@loewenheim loewenheim commented Jan 22, 2026

This introduces a new variant DeleteFirm (name provisional) of ProcessingAction that is intended to sit between DeleteHard and DeleteSoft: Hard removes the value entirely, Firm removes the value and and puts a remark in the metadata, Soft moves the value into the old_value in the metadata.

This new ProcessingAction is used in the EAP trimming processor to remember the keys of deleted attributes, up to a limit.

Open questions:

  • Is it reasonable to introduce a new ProcessingAction for this, or should the behavior of one of the others be modified?
  • Should DeleteFirm be able to carry data, like the name of the rule that caused the deletion, or maybe the entire remark?
  • Should we extend this to the original trimming processor? It contains some TODOs.

ref: #5568. ref: RELAY-196.

@linear
Copy link

linear bot commented Jan 22, 2026

@loewenheim loewenheim changed the title WIP WIP: Track removed keys in EAP trimming processor Jan 22, 2026
@loewenheim loewenheim requested a review from Dav1dde January 22, 2026 14:29
i = key.as_str();
}

let split_key = i.to_owned();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there's no way around this to_owned; we need the key to be detached from the map or we can't modify it.

@loewenheim loewenheim requested a review from a team January 26, 2026 09:23
Copy link
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

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

IMO DeleteValueHard should have carried a remark from the beginning, like the old TODOs suggest. But changing that now seems risky because it would suddenly increase event sizes, which would worse-case cause other data in the event to be dropped.

Introducing a new mode seems like the cautious thing to do, and we can gradually migrate fields to DeprecateHardWithRemark if we want to. I would definitely make sure that the old trimming processor can handle the new delete type as well.

Is it reasonable to introduce a new ProcessingAction for this, or should the behavior of one of the others be modified?
Should DeleteFirm be able to carry data, like the name of the rule that caused the deletion, or maybe the entire remark?
Should we extend this to the original trimming processor? It contains some TODOs.

self.0 = None;
self.1.add_remark(Remark {
ty: RemarkType::Removed,
rule_id: "delete_firm".to_owned(),
Copy link
Member

Choose a reason for hiding this comment

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

nit: I believe something like "trimmed" would provide more valuable info to the user here.

Suggested change
rule_id: "delete_firm".to_owned(),
rule_id: "trimmed".to_owned(),


/// Discards the value entirely, but leaves a remark.
#[error("value should be hard-deleted (unreachable, should not surface as error!)")]
DeleteValueFirm,
Copy link
Member

Choose a reason for hiding this comment

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

Though I appreciate "firm", I would call this "hard with remark" or just "with remark" instead.

Suggested change
DeleteValueFirm,
DeleteValueWithRemark,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, "Firm" was fully intended as a placeholder name.

@loewenheim
Copy link
Contributor Author

IMO DeleteValueHard should have carried a remark from the beginning, like the old TODOs suggest. But changing that now seems risky because it would suddenly increase event sizes, which would worse-case cause other data in the event to be dropped.

I think we need to keep a way of deleting stuff no questions asked because we can't afford to keep arbitrary user-set keys around without some limit.

@loewenheim loewenheim marked this pull request as ready for review January 27, 2026 11:45
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

loewenheim and others added 2 commits January 27, 2026 13:13
The variable tracking the current key was updated after the match
statement, causing incorrect split points when breaking early on
DeleteValueHard. Move the update before the match to ensure the
split key is always current.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Apply the same deletion logic pattern from process_attributes to
process_array. When size budget is exceeded, mark items with deletion
remarks when remark budget allows, falling back to hard deletion only
when the remark budget runs out.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
loewenheim and others added 2 commits January 27, 2026 13:31
Add a DeleteAction enum as the return type for delete_value that can be
converted into ProcessingAction. This makes the code more explicit about
the deletion logic and removes unreachable branches from match statements.

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@loewenheim loewenheim changed the title WIP: Track removed keys in EAP trimming processor feat(eap): Track removed keys in EAP trimming processor Jan 27, 2026
@loewenheim loewenheim requested review from Dav1dde and jjbayer January 28, 2026 10:20
@loewenheim loewenheim enabled auto-merge January 28, 2026 11:02
@loewenheim loewenheim added this pull request to the merge queue Jan 28, 2026
github-merge-queue bot pushed a commit that referenced this pull request Jan 28, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 28, 2026
@loewenheim loewenheim added this pull request to the merge queue Jan 28, 2026
Merged via the queue into master with commit c55f7b6 Jan 28, 2026
28 checks passed
@loewenheim loewenheim deleted the sebastian/delete-firm branch January 28, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants