Closed VIKTORVAV99 closed 2 days ago
@madsnedergaard @tonypls did we already resolve this issue?
As far as I can tell we are only importing the exchanges.json
file for the exchange arrow data (lonLat and direction). Which means it would be safe to remove the capacity data from the exchanges.json
file and get our bundle size and memory use down (we are currently including the capacity in the arrow objects as well).
Capacity data is not sent through the backend as far as I can tell, so still a TODO :)
# exchanges.json
AU-NSW->AU-QLD":{"capacity":[-1380,880],"lonlat":[146.503,-29.055],"rotation":0}
#app-backend
"2023-03-26T03:00:00Z": {co2intensity: 449.74, netFlow: -1094.92}
Capacity data is not sent through the backend as far as I can tell, so still a TODO :)
# exchanges.json AU-NSW->AU-QLD":{"capacity":[-1380,880],"lonlat":[146.503,-29.055],"rotation":0} #app-backend "2023-03-26T03:00:00Z": {co2intensity: 449.74, netFlow: -1094.92}
But the zone details have this object:
"exchangeCapacities": {
"DE": [
-985.0,
1000.0
],
"DK-DK1": [
-600.0,
590.0
],
"SE-SE4": [
-1700.0,
1300.0
]
},
So the backend definitely has the data and it's sent to the frontend, and I can't find any place where we import the exchange capacities in the exchanges.json file except for the arrows and we don't use it there.
This has been done for a while so closing the issue.
We should fetch the exchange capacity from the backend like we do for production capacities, this will allow us to update the capacity and have the change reflected instantly in the mobile apps without having to push new builds.
This will also allow us to remove the capacity information from the generated config files reducing it's size and removing the need to run
pnpm generate-zone-config
which are currently preventing "web only" edits using GitHubs online interface.