Conversation
stayallive
left a comment
There was a problem hiding this comment.
Soooo actually there is some discussion about the actual value maybe needing to be production instead of default, see discussion in #php on discord. Let's hold of a little bit before merging.
There was a problem hiding this comment.
So that was quick: getsentry/develop@676ab2b
We should change it to use production not default by default and allow the user to pass null if they want to (https://discordapp.com/channels/621778831602221064/621964286952210432/766052439660560384):
server is not going to enforce a default and a user can explicitly set to null if they really want to (though that's probably not a super great idea)
I guess that postpones our first deprecation for a bit 😉
We should also not default to that value in the options but only when creating the event or preparing it for sending (whatever makes more sense) and leave it null in the options itself because: https://discordapp.com/channels/621778831602221064/621964286952210432/766053912247271484.
a reason not to set it by default in the options object is that later on a framework you wouldn't be able to tell if the user set something explicitly programatically and you'd be overriding in the integration. So maybe best is to leave this in the client when preparing the event
Although those 2 conflict a bit in a sense, but considering we should always try to send one I would go for null in options and default to production in the Event when the environment is null.
According to getsentry/develop#169 the
environmentfield is now always required. Since we have to maintain the compatibility we cannot just make the propertynon-nullable, so I added our very first deprecation of the3.xseries that will suggest users to always pass astring. I also changed the default of the option as per documentation