Skip to content

ENG-6695: Do not allow call_script EventSpec to accept callback after being called#5571

Merged
adhami3310 merged 1 commit into
mainfrom
masenf/no-patial-callback
Jul 14, 2025
Merged

ENG-6695: Do not allow call_script EventSpec to accept callback after being called#5571
adhami3310 merged 1 commit into
mainfrom
masenf/no-patial-callback

Conversation

@masenf
Copy link
Copy Markdown
Collaborator

@masenf masenf commented Jul 14, 2025

No description provided.

@linear
Copy link
Copy Markdown

linear Bot commented Jul 14, 2025

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR implements a defensive programming improvement in the call_script event handling system. The change modifies how callback handling is implemented by explicitly setting callback_kwargs to {"callback": None} instead of using an empty dictionary. This is a subtle but important change that prevents the possibility of callbacks being added to an EventSpec after it has been created, which could lead to unexpected behavior.

This change aligns with good programming practices by making the code's behavior more explicit and eliminating a potential source of bugs where callbacks could be modified after the fact.

Confidence score: 5/5

  1. This PR is very safe to merge as it enforces stricter, more explicit behavior
  2. The change is small, focused, and implements a clear defensive programming pattern
  3. The event.py file needs review attention, but the changes are straightforward and well-contained

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jul 14, 2025

CodSpeed Performance Report

Merging #5571 will not alter performance

Comparing masenf/no-patial-callback (53237c5) with main (e02405d)

Summary

✅ 8 untouched benchmarks

@adhami3310 adhami3310 merged commit c82a942 into main Jul 14, 2025
39 of 41 checks passed
@adhami3310 adhami3310 deleted the masenf/no-patial-callback branch July 14, 2025 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants