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

Relative date matching uses the system timezone #2674

Open
leeturner opened this issue Apr 8, 2024 · 0 comments
Open

Relative date matching uses the system timezone #2674

leeturner opened this issue Apr 8, 2024 · 0 comments
Labels

Comments

@leeturner
Copy link
Contributor

Proposal

Currently, in the OSS library, a relative date-time matcher with an offset will use the system timezone to calculate the date-time to check against the request's actual value. This is problematic as the system timezone is arbitrary and non-deterministic from the perspective of the mock API’s configuration.

A fix for this would be to use the timezone of the request’s actual value, if provided. If the request’s actual value does not contain a timezone, maybe using a fixed timezone would be best (either provided by the user or just UTC).

There are other places in the date-time matcher code that use the system’s timezone, which could be fixed too.

More thought is required around whether this fix is feasible, as it could be a breaking change for existing users if they rely on the mock API using system timezone.

Reproduction steps

Create a relative date-time matcher with an offset and try and match

References

No response

@leeturner leeturner added the bug label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant