Skip to content

[medium] Zero refresh intervals are still polled every five seconds #6

@MeyerThorsten

Description

@MeyerThorsten

Severity: medium
Category: performance

A refresh interval of 0 currently means "update on every scheduler tick" instead of "self-managed / no polling".

Evidence:

  • src/main.ts:80 registers TrafficLayer with interval 0.
  • src/main.ts:85 registers PlacesLayer with interval 0.
  • src/layers/layer-manager.ts:93-98 runs layer.update() whenever now - meta.lastUpdate >= meta.interval, which is always true for 0.
  • src/layers/places-layer.ts:91-118 performs a live nearby-places API request inside update().

Impact:

  • self-managed layers still poll every 5 seconds
  • this burns API quota and increases rate-limit risk while the app is idle
  • unnecessary requests also add avoidable UI and network churn

Recommended fix:

  • treat 0 or negative intervals as manual-only and skip them in the scheduler
  • or add an explicit auto-refresh flag instead of overloading the interval value

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions