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] adding @Transactional to the ExecuteInject method to fix issue/2220 #2236

Open
wants to merge 1 commit into
base: release/current
Choose a base branch
from

Conversation

heditar
Copy link
Contributor

@heditar heditar commented Jan 17, 2025

Proposed changes

  • adding the @Transactionnal annotation to the InjectsExecutionJob.execute method to fix an issue with the Lazy initialization that was happening when an InjectStatus was saved

  • adding the @JsonIgnore annotation to Base.isListened method as the class StatusPayload as a an attribute payloadOutput that needs to be serialized and deserialized and having a property with a get a no set breaks the deserialization.
    This issue is only impacting FileDrop payload as the issue with serialization deserialization is on the Document class.

This PR doesn't include test as having a test that would be relevant to this bug would cost too much and would require refactoring.

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
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality
  • For bug fix -> I implemented a test that covers the bug

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

@heditar heditar changed the title adding @Transactional to the ExecuteInject method to fix issue/2220 [backend] adding @Transactional to the ExecuteInject method to fix issue/2220 Jan 17, 2025
@heditar heditar added the filigran team use to identify PR from the Filigran team label Jan 17, 2025
Copy link

codecov bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 32.90%. Comparing base (5988e76) to head (045d094).

Additional details and impacted files
@@                Coverage Diff                 @@
##             release/current    #2236   +/-   ##
==================================================
  Coverage              32.90%   32.90%           
  Complexity              1512     1512           
==================================================
  Files                    582      582           
  Lines                  17938    17938           
  Branches                1154     1154           
==================================================
  Hits                    5903     5903           
  Misses                 11771    11771           
  Partials                 264      264           

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

@@ -380,6 +381,7 @@ public void updateExercise(String exerciseId) {
exerciseRepository.save(exercise);
}

@Transactional
Copy link
Member

Choose a reason for hiding this comment

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

It seems risky to position it that high.
Were you able to analyze the impacts in relation to all the methods involved? We can work on this together if needed.

Copy link
Contributor Author

@heditar heditar Jan 17, 2025

Choose a reason for hiding this comment

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

I didn't spend too much time investigating potential impact as it seems to make sense to me that one "execute" was part of on transaction. What kind of impact are you worried about ? performance ?

@MarineLeM
Copy link
Contributor

i think I encounter the same problem with my task because InjectStatus gets updated throughout the process (e.g., adding traces), but in the catch block, the InjectStatus fetched from inject.getStatus() isn't in its latest state..

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.

3 participants