WildernessLabs / Meadow_Issues

Public repo for bugs and issues with Meadow
15 stars 0 forks source link

Device.PlatformOS.Sleep allows DateTime and TimeSpan entries that are too limited and DateTime values that have already past #558

Open Peter-Moody opened 1 year ago

Peter-Moody commented 1 year ago

Problem description Meadow.OS has been enhanced to allow time in seconds to be greater than 0xffff (65545). The new maximum is 28 days - 1 second or 2,419,199 seconds. Please make this change in the appropriate code of Meadow.Foundation or Meadow.Core. It was also noted that a date could be entered that had already passed. This will cause Meadow.OS to return an error where this condition is tested. It would be better to catch it in MC or MF.

Repo steps Steps to reproduce the behavior:

  1. Create a Meadow App using DateTime that is greater than 18 hours 15 minutes in the future and use it to call Device.PlatformOS.Sleep().
  2. Create a Meadow App using DateTime where the time has already passed and use it to call Device.PlatformOS.Sleep().

Expected behavior

  1. An error should be reported that when DateTime has already past.
  2. An error should be reported when the DateTime is more than 2,419,199 second in the future.

Screenshots If applicable, add screenshots to help explain your problem.

Meadow.Foundation (please complete the following information as best as you can):

Developer tools (please complete the following information as best as you can):

Meadow (please complete the following information as best as you can): Most of these values can be found by running meadow device info using the Meadow CLI.

adrianstevens commented 1 year ago

Fantastic - thx @Peter-Moody, i'll work with @ctacke to make the appropriate changes