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

Auto on session tracking #517

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from
Draft

Auto on session tracking #517

wants to merge 30 commits into from

Conversation

Cawllec
Copy link
Contributor

@Cawllec Cawllec commented Feb 6, 2019

Goal

  • Make AutoCaptureSessions true by default
    • This is the end goal of this PR
  • Allow endpoints to be set through the Client/Configuration after initialization.
    • Previously the endpoint could only be set during initialization by its inclusion in the GuzzleHttp\Client. As the Guzzle client is immutable after instantiation, this meant that any method of ensuring that the notify and session endpoints were both set would be needlessly complex.
    • By removing the notify endpoint setup from initialization, and setting it with the session endpoint in setEndpoint, it allows the same logic that's been used across the other notifiers for setting endpoints to be utilized.
    • This also allows consistency with how the other notifiers work.
  • Ensure only one GuzzleClient is created (by the notifier) during each run and only if necessary.
    • Previously a guzzle client was always created during the initialization, which made up approximately 75% of the initialization memory usage.
    • By lazily creating the guzzle client when necessary, it saves a lot of the Bugsnag overhead in scenarios where no notifications will be delivered.
    • This is also required by this PR to allow users to configure a custom guzzle to be used for testing or custom delivery setup, which they may have required previously.

UPGRADING.md Outdated Show resolved Hide resolved
UPGRADING.md Outdated Show resolved Hide resolved
UPGRADING.md Outdated Show resolved Hide resolved
Copy link
Contributor

@snmaynard snmaynard left a comment

Choose a reason for hiding this comment

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

Lets chat tomorrow because I think I'm missing some context on the changeset. If you think its sensible to decouple some of these changes then feel free to go ahead and make any changes you see fit, but if i just need more context on why this is the right way we can chat tomorrow!

UPGRADING.md Outdated
);
```

#### Configuring the GuzzleHttp Client
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this change required for always on session tracking?

UPGRADING.md Outdated
$bugsnag->setGuzzleClient($myCustomGuzzle);
```

#### Deprecation
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this change required for always on session tracking?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This isn't, but should be removed if this is a major release. I've removed it as it'll be a part of a release PR instead.

UPGRADING.md Outdated
@@ -1,14 +1,78 @@
Upgrading
=========

## 3.x to 4.x
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than bumping the major version why not support backwards compat?

*
* @return void
*/
public function __construct(Configuration $config, ClientInterface $guzzle)
public function __construct(Configuration $config)
Copy link
Contributor

Choose a reason for hiding this comment

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

why has passing guzzle in been deprecated?

@Cawllec
Copy link
Contributor Author

Cawllec commented Feb 12, 2019

I've removed the non-pertinent changes that were a part of this PR originally, and attempted to clarify a number of the questions that require more context.

@Cawllec Cawllec changed the base branch from next to master February 13, 2019 17:45
@Cawllec Cawllec added the on hold label Nov 1, 2019
@Cawllec
Copy link
Contributor Author

Cawllec commented Nov 1, 2019

This is on hold for now, and will require review and possibly redevelopment in the future

@xljones xljones added wip There is work in progress and removed on hold labels Apr 30, 2020
@tomlongridge tomlongridge marked this pull request as draft August 14, 2020 13:14
@tomlongridge tomlongridge removed the request for review from GrahamCampbell August 14, 2020 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wip There is work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants