Inconsistencies between user.trialStartedAt value formats
marioaburto10 opened this issue · 6 comments
Issue
I noticed that the property user.trialStartedAt
has a timestamp
value (for example 2023-05-26T04:21:42.296Z
) when the user
object is being returned within the onTrialStarted
listener. When the user
object is being returned from the getUser()
method, the value is a Date()
object (for example Thu May 25 2023 21:21:42 GMT-0700 (Pacific Daylight Time)
). The docs say that the values for the property user.trialStartedAt
can either be null
or a Date()
object without mentioning the timestamp
type.
Suggested fix
Is this an easy code fix that can be implemented so that a Date()
object is returned for the property user.trialStartedAt
instead of a timestamp
value within the onTrialStarted
listener? Otherwise an update to the docs would be good. Thank you.
I can't reproduce this. Both values are datetimes in the minimal test case I created. Please create an extension that minimally demonstrates the bug you're describing.
@Glench before I put something together, can you confirm that you've ran through the use case where you've used a valid email other than a test email in a test use case? I see different behavior when I go through a test trial case vs when I use a different email as an actual user signing up for a trial.
I tried with a real email. You'll need to create a minimal test case and walk me through exactly the steps to reproduce. I'm kind of skeptical the bug you mention is even possible because if you look at the code the same exact function is used in all cases, for onPaid and onTrialStarted listeners.
Any update on this?
I haven't had the time to create a minimal extension. I'll circle back to this this weekend.
But I have a workaround in place so I don't see a need to troubleshoot this further. Thank you @Glench