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

[BIOMAGE-1747] Expired token #335

Merged
merged 7 commits into from
Apr 22, 2022
Merged

[BIOMAGE-1747] Expired token #335

merged 7 commits into from
Apr 22, 2022

Conversation

kafkasl
Copy link
Contributor

@kafkasl kafkasl commented Apr 21, 2022

Description

The issue was caused by the sendNotification hook. This hook uses the jwtToken to get the current user information to know who to send the email notifications too (and also to add the user name to our slack notifications). Whenever, the token was expired, the hookRunner failed, crashing the qc|gem2s response handlers.

Changes

  • sendNotification now ignores if the jwtToken is expired because it only cares about the user info
  • hookRunner.run() runs inside a try/catch to prevent any hook problem from propagating and interrupting the original calling function (hooks are by definition side-effects, so any error should not stop the main program).

Details

URL to issue

https://biomage.atlassian.net/browse/BIOMAGE-1747

Link to staging deployment URL (or set N/A)

N/A

Links to any PRs or resources related to this PR

Integration test branch

master

Merge checklist

Your changes will be ready for merging after all of the steps below have been completed.

Code updates

Have best practices and ongoing refactors being observed in this PR

  • Migrated any selector / reducer used to the new format.

Manual/unit testing

  • Tested changes using InfraMock locally or no tests required for change, e.g. Kubernetes chart updates.
  • Validated that current unit tests for code work as expected and are sufficient for code coverage or no unit tests required for change, e.g. documentation update.
  • Unit tests written or no unit tests required for change, e.g. documentation update.

Integration testing

You must check the box below to run integration tests on the latest commit on your PR branch.
Integration tests have to pass before the PR can be merged. Without checking the box, your PR
will not pass the required status checks for merging.

  • Started end-to-end tests on the latest commit.

Documentation updates

  • Relevant Github READMEs updated or no GitHub README updates required.
  • Relevant Wiki pages created/updated or no Wiki updates required.

Optional

  • Staging environment is unstaged before merging.
  • Photo of a cute animal attached to this PR.

image

@codecov
Copy link

codecov bot commented Apr 21, 2022

Codecov Report

Merging #335 (1018ed3) into master (5244c3f) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #335      +/-   ##
==========================================
+ Coverage   83.98%   83.99%   +0.01%     
==========================================
  Files         126      126              
  Lines        3503     3506       +3     
  Branches      392      393       +1     
==========================================
+ Hits         2942     2945       +3     
  Misses        512      512              
  Partials       49       49              
Impacted Files Coverage Δ
src/utils/authMiddlewares.js 40.35% <100.00%> (ø)
src/utils/hooks/hookRunner.js 100.00% <100.00%> (ø)
src/utils/hooks/send-notification.js 93.75% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5244c3f...1018ed3. Read the comment docs.

@kafkasl kafkasl force-pushed the expired-token branch 2 times, most recently from c60b133 to b65c6ad Compare April 22, 2022 09:18
Copy link
Member

@ivababukova ivababukova left a comment

Choose a reason for hiding this comment

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

remove the console logs and the commented out line and it's good to merge. Are these storks (the cute animals photo)?

@kafkasl kafkasl force-pushed the expired-token branch 2 times, most recently from a47845e to 7535a61 Compare April 22, 2022 15:42
@kafkasl
Copy link
Contributor Author

kafkasl commented Apr 22, 2022

remove the console logs and the commented out line and it's good to merge. Are these storks (the cute animals photo)?

I assume they are haha japanese ones maybe

@kafkasl kafkasl merged commit 0179084 into master Apr 22, 2022
@kafkasl kafkasl deleted the expired-token branch April 22, 2022 15:59
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