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 #373 breaking collecting user information on *not* starlette #385

Merged
merged 8 commits into from
Sep 21, 2021

Conversation

terencehonles
Copy link
Contributor

@terencehonles terencehonles commented Jul 1, 2021

Description of the change

The change fixes the check to match the previous code:

if not StarletteRequest and hasattr(request, 'user'):

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Related issues

  • fix [ch91323]

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers mentioned in a comment
  • Changes have been reviewed by at least one other engineer
  • Issue from task tracker has a link to this pull request

The change fixes the check to match the previous code:

  `if not StarletteRequest and hasattr(request, 'user'):`
@terencehonles
Copy link
Contributor Author

@bxsx do you mind looking at this? This fixes the change here 0c59ade as part of #373

@terencehonles terencehonles changed the title fix #373 breaking collecting users information on *not* starlette fix #373 breaking collecting user information on *not* starlette Jul 1, 2021
@bxsx
Copy link
Contributor

bxsx commented Jul 2, 2021

Thanks for reporting and PR. The fix looks reasonable. I will double-check it next week as the failing commit was necessary to bypass Starlette's security layer. I want to make sure it works fine in both cases.

@bxsx bxsx self-assigned this Jul 2, 2021
@terencehonles
Copy link
Contributor Author

terencehonles commented Jul 2, 2021

Thanks for reporting and PR. The fix looks reasonable. I will double-check it next week as the failing commit was necessary to bypass Starlette's security layer. I want to make sure it works fine in both cases.

Thanks, the starlette path should still be taken if it's installed so it should be good, but we're running off our fork for the time being so no rush and do whatever validation you think is necessary. I'm slightly surprised there isn't a test for this since I noticed you did add a test for the starlette path so I would have figured there would be the same already, but I guess not and you possibly added the first test for that area 😅 .

@terencehonles
Copy link
Contributor Author

@bxsx / @waltjones any chance this can be reviewed / merged sometime soon?

@waltjones
Copy link
Contributor

@bxsx will need to look.

@terencehonles
Copy link
Contributor Author

@bxsx any chance you have some time soon to review this?

@bxsx bxsx self-requested a review September 18, 2021 23:46
@bxsx
Copy link
Contributor

bxsx commented Sep 19, 2021

Hi @terencehonles

Thanks again for the PR and sorry that it took a bit longer than it should.

I approved the changes and added more tests around, so both Django and Starlette should be safe now ;)
I also refactored the code, eliminating the anonymous function for better traceback and representation.

As this PR contains changes from another unmerged branch (to fix CI builds) it will be merged after #389 approval (within few days).

@bxsx bxsx mentioned this pull request Sep 19, 2021
11 tasks
@shortcut-integration
Copy link

@bxsx bxsx merged commit b3d3a10 into rollbar:master Sep 21, 2021
@terencehonles terencehonles deleted the fix-collecting-users-on-django branch September 21, 2021 17:14
@bxsx
Copy link
Contributor

bxsx commented Sep 22, 2021

@terencehonles we have just released the 0.16.2 version which includes this PR. Thank you for your contribution!

@bxsx bxsx added this to the v0.16.2 milestone Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants