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

Fix session bug caused by [email protected] #347

Merged
merged 1 commit into from
Nov 15, 2023
Merged

Conversation

jribbink
Copy link
Contributor

@jribbink jribbink commented Nov 15, 2023

closes #348

Description

v2.1.9 of the playground API is not working in staging. I have debugged this and determined that the sentry update that was mandatory as a part of updating to the latest version of Cadence was responsible. It broke the session middleware

Namely, it has to do with how sentry affects the request context when being run twice in the middeware stack. Sentry stores the current transaction in the context & if one exists already, then it uses this transaction. However, this causes the request context to get rolled back to where it was during the first middleware call -> effectively removes any middleware values set between sentry middleware calls.

TL;DR this PR removes a redundant sentry middleware that was breaking the Playground. I also removed gorilla/mux because we aren't using it and it was just being used for a type.


For contributor use:

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the standards mentioned here.
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@@ -170,7 +171,6 @@ func main() {

r.Use(httpcontext.Middleware())
r.Use(sessions.Middleware(cookieStore))
r.Use(monitoring.Middleware())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jribbink jribbink merged commit 4bf2e3f into v2 Nov 15, 2023
26 checks passed
@jribbink jribbink deleted the jribbink/fix-sentry-bug branch November 15, 2023 18:04
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.

Sessions broken in v2.1.9
3 participants