Closed marioaburto10 closed 1 year ago
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
Issue I noticed that the property
user.trialStartedAt
has atimestamp
value (for example2023-05-26T04:21:42.296Z
) when theuser
object is being returned within theonTrialStarted
listener. When theuser
object is being returned from thegetUser()
method, the value is aDate()
object (for exampleThu May 25 2023 21:21:42 GMT-0700 (Pacific Daylight Time)
). The docs say that the values for the propertyuser.trialStartedAt
can either benull
or aDate()
object without mentioning thetimestamp
type.Suggested fix Is this an easy code fix that can be implemented so that a
Date()
object is returned for the propertyuser.trialStartedAt
instead of atimestamp
value within theonTrialStarted
listener? Otherwise an update to the docs would be good. Thank you.