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

[backend] now also send event_id for events sent to worker coming from stream (#9824) #9791

Merged
merged 7 commits into from
Feb 4, 2025

Conversation

JeremyCloarec
Copy link
Contributor

@JeremyCloarec JeremyCloarec commented Jan 31, 2025

Proposed changes

  • out of date events coming from stream could be processed even if they should be ignored
  • now send originating eventId in streams if current event resulted from an external event

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case (coverage and e2e)
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

@github-actions github-actions bot added the filigran team use to identify PR from the Filigran team label Jan 31, 2025
Copy link

codecov bot commented Jan 31, 2025

Codecov Report

Attention: Patch coverage is 27.27273% with 16 lines in your changes missing coverage. Please review.

Project coverage is 65.24%. Comparing base (d07a682) to head (3c799eb).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...tform/opencti-graphql/src/graphql/sseMiddleware.js 0.00% 6 Missing ⚠️
...latform/opencti-graphql/src/manager/syncManager.js 0.00% 4 Missing ⚠️
...latform/opencti-graphql/src/database/middleware.js 40.00% 3 Missing ⚠️
...orm/opencti-graphql/src/manager/playbookManager.ts 0.00% 2 Missing ⚠️
...cti-platform/opencti-graphql/src/database/redis.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9791   +/-   ##
=======================================
  Coverage   65.24%   65.24%           
=======================================
  Files         630      630           
  Lines       60411    60421   +10     
  Branches     6783     6787    +4     
=======================================
+ Hits        39413    39423   +10     
  Misses      20998    20998           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -57,4 +57,5 @@ interface AuthContext {
tracing: TracingContext
user: AuthUser | undefined
draft_context?: string | undefined
eventId?: string | undefined
Copy link
Member

Choose a reason for hiding this comment

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

other fields seem to be snake case, why not this one?

Copy link
Member

Choose a reason for hiding this comment

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

and in the other files you changed event_id is snake case

Copy link
Member

Choose a reason for hiding this comment

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

It's a field that existed already in AuthContext, it has been declared here for typing (it was only used in js files)

@JeremyCloarec JeremyCloarec changed the title [backend] now also send event_id for events sent to worker coming from stream [backend] now also send event_id for events sent to worker coming from stream (#9824) Feb 4, 2025
@JeremyCloarec JeremyCloarec merged commit 6f63fcd into master Feb 4, 2025
9 checks passed
@JeremyCloarec JeremyCloarec deleted the oob/streamEventId branch February 4, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filigran team use to identify PR from the Filigran team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

An infinite update loop can happen when two instances listen to each other streams
5 participants