Open YaSuenag opened 1 year ago
I have mixed opinions on this, so will share both reasons why I think we might want it and why not. Why we SHOULD throw an exception:
Why we SHOULDN'T throw an exception:
Additionally, when implementing this we need to think in which timezone and at what times the cutoff time for most recent emission is - e.g. if EMFree has a few hour delay, then requesting current time emissions might be invalid, as the most recent emission is from few hours ago.
maybe we need to keep in mind future datasources which might accept time ranges for future dates on historical endpoints. This can be disregarded however, if we never want to allow forecast data to be returned from a historical endpoint (which does make sense).
I think we can disallow historical endpoint never accept request for forecasting because it is for "historical".
Additionally, when implementing this we need to think in which timezone and at what times the cutoff time for most recent emission is - e.g. if EMFree has a few hour delay, then requesting current time emissions might be invalid, as the most recent emission is from few hours ago.
I've raised this issue about passing future datetime to historical endpoint, so I think we don't need to think about this case.
But I think we can following cases:
I think your concern fits case 2 and 3, it means the SDK user specifies start datetime, so I think it can be allowed that the SDK would not return any data when emission data is out of specified time range.
Can we please create an ADR for this as per the meeting last week on the 2023-10-10 #402 . Thanks!
This issue has not had any activity in 120 days. Please review this issue and ensure it is still relevant. If no more activity is detected on this issue for the next 20 days, it will be closed automatically.
Wait, do not close this issue.
I will start to work when I can (maybe after clarifying vNext
)
What is next on this one please?
This issue has not had any activity in 120 days. Please review this issue and ensure it is still relevant. If no more activity is detected on this issue for the next 20 days, it will be closed automatically.
Please remove stale
label from this issue.
Priority of this issue is not high, but it is worth to discuss I think. I'll back when other issues/PRs are closed.
This issue has not had any activity in 120 days. Please review this issue and ensure it is still relevant. If no more activity is detected on this issue for the next 20 days, it will be closed automatically.
Please remove stale label from this issue.
What happened?
We would receive HTTP 204 (No content) when we pass future datetime to endpoints of current/historical data (e.g. /emissions/bylocation) in WebAPI. However these endpoints would not handle forecast data, so future datetime as parameters are not expected.
We've discussed about this whether it would be better to throw exception (e.g. ArgumentOutOfRangeException) in this case in #389 and #384. If throwing exception is appropriate, we need to fix all of datasources (WattTime, ElectricityMaps, ElectricityMapsFree, JSON).
Code of Conduct
Feature Commitment