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

[2.0] Merge up to 1.9 #592

Merged
merged 20 commits into from
May 9, 2018
Merged

[2.0] Merge up to 1.9 #592

merged 20 commits into from
May 9, 2018

Conversation

Jean85
Copy link
Collaborator

@Jean85 Jean85 commented May 3, 2018

This is a continuation of the work of #526, continuosly porting all the new stuff from the master branch into the 2.0. This is the list of merged PRs on master that I've ported here (by merge order on master):

I will handle those PHPT regression tests separately:

PHP doesn't have `gzipCompress` function, use `gzcompress` instead
http://php.net/manual/en/function.gzcompress.php

(cherry picked from commit d391712)
@Jean85 Jean85 added this to the Release 2.0 milestone May 3, 2018
@Jean85 Jean85 self-assigned this May 3, 2018
Jean85 and others added 4 commits May 4, 2018 09:45
@Jean85
Copy link
Collaborator Author

Jean85 commented May 4, 2018

@ste93cry while trying to port #555 I discovered that the site field got lost during the development of the 2.x. Is it a custom field that we are ditching since we already have the standard server_name?

(cherry picked from commit f9c90cf)
@ste93cry
Copy link
Collaborator

ste93cry commented May 4, 2018

It was removed because it's a deprecated field

@Jean85
Copy link
Collaborator Author

Jean85 commented May 4, 2018

@ste93cry looking at #578 I discovered that the trust_x_forwarded_proto option is handled but never used... what should we do?

@ste93cry
Copy link
Collaborator

ste93cry commented May 4, 2018

According to the security issues that could arise by using the X_FORWARDED_* headers I would remove the configuration option entirely and not take any action regarding support of this particular feature in the PHP SDK

$this->markTestSkipped('mbstring extension is not enabled.');
}

$testString = 'Прекратите надеяться, что ваши пользователи будут сообщать об ошибках';
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is so funny! It's the Google-translated version of Stop hoping that your users will report bugs in russian :trollface:

Copy link
Collaborator

Choose a reason for hiding this comment

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

I couldn't just add some random text, needs to make a little bit sense at least 😉

@Jean85 Jean85 mentioned this pull request May 4, 2018
15 tasks
@Jean85 Jean85 changed the title [WIP] [2.0] Merge up to 1.9 [2.0] Merge up to 1.9 May 4, 2018
@Jean85 Jean85 requested review from ste93cry, dcramer and stayallive May 4, 2018 10:58
@Jean85
Copy link
Collaborator Author

Jean85 commented May 4, 2018

This is no longer WIP, I will handle the PHPT tests separately, please review!

@ste93cry
Copy link
Collaborator

ste93cry commented May 4, 2018

I know that this argument has already been discussed many times and widely, but I strongly disagree with gathering the POST data and deserialize it if it's JSON. Now that we have a well organized way to collect all information we and users need through middlewares everyone can easily add whatever they want to the event data, and the SDK specs also says:

This data should not be provided by default as it can get quite large

This is the main reason I did not collect POST data by default in the RequestInterfaceMiddleware middleware. If we really want to keep going this way, we should at least use the PSR-7 methods to get the data instead of using file_get_contents directly.

Copy link
Collaborator

@stayallive stayallive left a comment

Choose a reason for hiding this comment

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

It's a large PR so I skimmed over it but looks like it's all the changes from 1.9.0 and in the right places, so 👍

@Jean85
Copy link
Collaborator Author

Jean85 commented May 4, 2018

This data should not be provided by default as it can get quite large

Oh well, then I think we should create a separated middleware to do that!

This is the main reason I did not collect POST data by default in the RequestInterfaceMiddleware middleware. If we really want to keep going this way, we should at least use the PSR-7 methods to get the data instead of using file_get_contents directly.

What's the correct method to do it?

@ste93cry
Copy link
Collaborator

ste93cry commented May 4, 2018

I think you should use the getBody() method of the ServerRequestInterface interface

@Jean85
Copy link
Collaborator Author

Jean85 commented May 4, 2018

Ok I've reverted the commit about #546, I will handle it in a separate PR where I will create a separated middleware to handle POST body, with JSON handling too.

@ste93cry
Copy link
Collaborator

ste93cry commented May 6, 2018

#587 should not apply to 2.x as we don't set anymore the event_id property

@Jean85
Copy link
Collaborator Author

Jean85 commented May 6, 2018

#587 should not apply to 2.x as we don't set anymore the event_id property

Yep, but I've preferred to port the regression test anyway, so we will never have issues like that one in the future, for whatever reason.

@ste93cry
Copy link
Collaborator

ste93cry commented May 6, 2018

I can't see where the event_id property is set in the test, maybe you forgot it?

@Jean85
Copy link
Collaborator Author

Jean85 commented May 6, 2018

The event_id was set in the code of 1.x. The core of the issue is an exception that throws an other exception on __set, which would be triggered in a number of ways; in 1.x was the event_id.

@ste93cry
Copy link
Collaborator

ste93cry commented May 6, 2018

What I meant is that I don't see anything in the test that tries to set the event_id property on the exception object (which in turn should throw another exception), so how can the test work? By the way, are you sure that the same case (throwing an exception while already handling one) is not covered by my PR that refactors the error handler?

@Jean85
Copy link
Collaborator Author

Jean85 commented May 6, 2018

It's possible that is already covered by your PR, yes.

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.

7 participants