Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(SessionTracker): remove automatic session capturing for Lumen 5.3+#358

Merged
tomlongridge merged 4 commits into
nextfrom
tom/lumen_53_session_support
Aug 1, 2019
Merged

fix(SessionTracker): remove automatic session capturing for Lumen 5.3+#358
tomlongridge merged 4 commits into
nextfrom
tom/lumen_53_session_support

Conversation

@tomlongridge
Copy link
Copy Markdown
Contributor

@tomlongridge tomlongridge commented Jul 8, 2019

Goal

session() is not available after Lumen 5.3 - this change prevents session tracking setup if the
method is not available.

Changeset

Changed

  • BugsnagServiceProvider: setupSessionTracking now does nothing if session is not available.

Tests

Manually tested that no exception occurs on Lumen and that session information continues to work on Laravel.

Review

For the submitter, initial self-review:

  • Commented on code changes inline explain the reasoning behind the approach
  • Reviewed the test cases added for completeness and possible points for discussion
  • A changelog entry was added for the goal of this pull request
  • Check the scope of the changeset - is everything in the diff required for the pull request?
  • This pull request is ready for:
    • Initial review of the intended approach, not yet feature complete
    • Structural review of the classes, functions, and properties modified
    • Final review

For the pull request reviewer(s), this changeset has been reviewed for:

  • Consistency across platforms for structures or concepts added or modified
  • Consistency between the changeset and the goal stated above
  • Internal consistency with the rest of the library - is there any overlap between existing interfaces and any which have been added?
  • Usage friction - is the proposed change in usage cumbersome or complicated?
  • Performance and complexity - are there any cases of unexpected O(n^3) when iterating, recursing, flat mapping, etc?
  • Concurrency concerns - if components are accessed asynchronously, what issues will arise
  • Thoroughness of added tests and any missing edge cases
  • Idiomatic use of the language

@tomlongridge tomlongridge force-pushed the tom/lumen_53_session_support branch from c298d8f to c8c7f38 Compare July 8, 2019 13:24
`session()` is not available after Lumen 5.3 - this change prevents session tracking setup if the
method is not available
@tomlongridge tomlongridge force-pushed the tom/lumen_53_session_support branch from c8c7f38 to 29f99a1 Compare July 8, 2019 13:29
@tomlongridge tomlongridge marked this pull request as ready for review July 8, 2019 13:31
@tomlongridge tomlongridge requested a review from Cawllec July 8, 2019 13:31
Copy link
Copy Markdown
Contributor

@Cawllec Cawllec left a comment

Choose a reason for hiding this comment

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

I think this could do with some additional docs, both in the notifier and the platforms docs themselves.

Comment thread src/BugsnagServiceProvider.php Outdated
// Session support removed in Lumen 5.3 - only setup automatic session
// tracking if the session function is avaiable
if (!function_exists('session')) {
return;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it would be worth adding a log here to mention that sessions are not automatically being tracked, as someone may expect if they set the configuration option.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm struggling to log anything (using Laravel logging) as it calls recursively into the Bugsnag setup code for the BugsnagLogger handling. Is there a lower-level approach that could be used to log?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Also, given the fact that it doesn't currently work and there should be an alternative solution to allow support for this in the not-too-distant-future, I think it's not too important to log this if it proves difficult.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, I hadn't considered the logging straight to Bugsnag aspect. In theory it shouldn't be a problem if the log-level is high enough, but there's no guarantee there, and I haven't actually tried it myself.

In which case it's probably fine to not log.

Copy link
Copy Markdown
Contributor

@Cawllec Cawllec left a comment

Choose a reason for hiding this comment

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

In light of the comments above, this looks good, although it will probably require a documentation update to note that sessions will not be automatically collected in Laravel.

@tomlongridge tomlongridge force-pushed the tom/lumen_53_session_support branch from e25fadb to c75e77c Compare July 23, 2019 14:33
@tomlongridge tomlongridge force-pushed the tom/lumen_53_session_support branch from dfdee16 to 99d9726 Compare July 23, 2019 15:13
@tomlongridge tomlongridge requested a review from Cawllec July 24, 2019 15:15
Copy link
Copy Markdown
Contributor

@Cawllec Cawllec left a comment

Choose a reason for hiding this comment

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

This still looks good, testing locally works.

@tomlongridge tomlongridge changed the base branch from master to next August 1, 2019 13:50
@tomlongridge tomlongridge merged commit 4165b56 into next Aug 1, 2019
@tomlongridge tomlongridge deleted the tom/lumen_53_session_support branch August 1, 2019 13:53
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