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] Share/unshare tasks should be done by creation date from olders to more recents to have correctly ordered stream events (#8843)(#9200)(#9371) #9394

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

aHenryJard
Copy link
Member

@aHenryJard aHenryJard commented Dec 17, 2024

Proposed changes

  • add orderMode as parameter in task creation and use it when qureying elastic.
  • add an event on parent container at the end of sharing / unshare tasks
  • add try/catch on get file from storage issue

Other improvement:

  • change verbose log on xtm
  • prevent the stacktrace on session already closed when a favicon is requested ("Error: Cannot set headers after they are sent to the client)

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 Dec 17, 2024
@aHenryJard aHenryJard changed the title Searching the way to send asc in tasks. Still WIP. [backend] Share/unshare tasks should be done by creation date from olders to more recents to have correctly ordered stream events Dec 19, 2024
@aHenryJard aHenryJard changed the title [backend] Share/unshare tasks should be done by creation date from olders to more recents to have correctly ordered stream events [backend] Share/unshare tasks should be done by creation date from olders to more recents to have correctly ordered stream events (#8843) Dec 19, 2024
@aHenryJard aHenryJard marked this pull request as ready for review December 19, 2024 08:49
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 44.68085% with 26 lines in your changes missing coverage. Please review.

Project coverage is 65.37%. Comparing base (e4728c3) to head (ef3846e).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...latform/opencti-graphql/src/manager/taskManager.js 60.00% 8 Missing ⚠️
...pencti-platform/opencti-graphql/src/domain/stix.js 40.00% 6 Missing ⚠️
...latform/opencti-graphql/src/manager/syncManager.js 0.00% 6 Missing ⚠️
...tform/opencti-graphql/src/domain/backgroundTask.js 57.14% 3 Missing ⚠️
...-platform/opencti-graphql/src/http/httpPlatform.js 0.00% 2 Missing ⚠️
...-platform/opencti-graphql/src/database/xtm-obas.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9394      +/-   ##
==========================================
+ Coverage   65.34%   65.37%   +0.02%     
==========================================
  Files         624      624              
  Lines       59697    59723      +26     
  Branches     6687     6696       +9     
==========================================
+ Hits        39011    39041      +30     
+ Misses      20686    20682       -4     

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

@aHenryJard aHenryJard marked this pull request as draft December 19, 2024 12:58
@aHenryJard aHenryJard changed the title [backend] Share/unshare tasks should be done by creation date from olders to more recents to have correctly ordered stream events (#8843) [backend] Share/unshare tasks should be done by creation date from olders to more recents to have correctly ordered stream events (#8843)(#9200)(#9371) Dec 26, 2024
@aHenryJard aHenryJard force-pushed the issue/8843 branch 2 times, most recently from 59ee949 to 2add871 Compare December 26, 2024 10:32
@@ -486,8 +486,9 @@ const createApp = async (app) => {
res.set('Expires', '-1');
res.set('Pragma', 'no-cache');
res.send(withOptionValued);
} else {
res.status(503).send({ status: 'error', error: 'Interface is disabled by configuration' });
Copy link
Member Author

Choose a reason for hiding this comment

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

Adding an else prevent a stacktrace in log when favicon is requested.

@aHenryJard aHenryJard marked this pull request as ready for review January 2, 2025 08:10
@@ -194,7 +194,7 @@ export const getScenarioResult = async (id: string) => {
human,
};
} catch (err) {
logApp.info('Scenario not found in OpenBAS', { err });
logApp.debug('Scenario not found in OpenBAS', { err });
Copy link
Member

Choose a reason for hiding this comment

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

Is the use of logApp.debug even necessary now?

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
2 participants