Skip to content

Commit f2395ba

Browse files
committed
Added comment to manual charge logic removal, as it might need a rework in the future
1 parent 524f998 commit f2395ba

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

server/logic.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ export class Logic {
294294

295295
if (vehicle.location_uuid && vehicle.location_uuid !== was.location_uuid) {
296296
// Remove all manual charge schedules if we move from a known location to anything else
297+
// TODO: This is not optimal as the user might have set a scheduled manual charge at an known location
298+
// and if we're unlucky, the vehicle may move in and out of a location while towards it, because of the geo-fence just being a radius
297299
const removed = await this.db.pg.oneOrNone(
298300
`DELETE FROM schedule WHERE vehicle_uuid = $1 AND schedule_type = $2 RETURNING *;`,
299301
[vehicle.vehicle_uuid, ScheduleType.Manual]

0 commit comments

Comments
 (0)