Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only send node mutation events when there has been a change #5763

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

ogenstad
Copy link
Contributor

@ogenstad ogenstad commented Feb 14, 2025

For idempotent mutations where we don't modify an object we should not send an event.

Fixes #5760

@github-actions github-actions bot added the group/backend Issue related to the backend (API Server, Git Agent) label Feb 14, 2025
Copy link

codspeed-hq bot commented Feb 14, 2025

CodSpeed Performance Report

Merging #5763 will not alter performance

Comparing pog-mutation-events-only-on-updates-IFC-1247 (6a540ef) with develop (927ff90)

Summary

✅ 11 untouched benchmarks

@ogenstad ogenstad force-pushed the pog-mutation-events-only-on-updates-IFC-1247 branch from 94c97ee to 26350cb Compare February 17, 2025 07:42
@ogenstad ogenstad marked this pull request as ready for review February 17, 2025 09:20
@ogenstad ogenstad requested a review from a team as a code owner February 17, 2025 09:20
@@ -228,6 +228,10 @@ def updated_fields(self) -> list[str]:
"""Return a list of update fields i.e. attributes and relationships"""
return list(self.relationships.keys()) + list(self.attributes.keys())

@property
def has_changes(self) -> bool:
return bool(self.updated_fields)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit pick but I think len(self.updated_fields) > 0 is clearer

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 that the original is perhaps a bit more Pythonic, but either or is fine with me. I've pushed an update.

@ogenstad ogenstad force-pushed the pog-mutation-events-only-on-updates-IFC-1247 branch from 26350cb to 6a540ef Compare February 17, 2025 11:58
@ogenstad ogenstad merged commit 2553ba2 into develop Feb 17, 2025
35 checks passed
@ogenstad ogenstad deleted the pog-mutation-events-only-on-updates-IFC-1247 branch February 17, 2025 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants