Skip to content

polish: address sonnet-reviewer findings on PR #15 (TimeOverrideStratum) #16

Description

@HichemMokni

Non-blocking findings from sonnet-reviewer on PR #15 (merged). Capture for cleanup before upstream PR review on TerriaJS#7835.

  1. Dead code: if (!t) return undefined guard in TimeOverrideStratum.discreteTimes never fires (TerriaJS object-traits always materialize wrapper). Remove or replace with field-level guard for clarity.

  2. Silent failure: time: { start: "X", stop: "Y" } without period produces no discreteTimes and no diagnostic. Add a console.warn so catalog authors see the misconfiguration: "WebMapTileServiceCatalogItem: time.start + time.stop given without time.period; discrete time list is empty. Add a period (e.g., 'P1D')."

  3. Untested contract: defaultValue outside the values list sets currentTime to a string not in discreteTimes. DiscretelyTimeVaryingMixin behavior in that case is unspecified. Either: (a) constrain — set currentTime to the closest matching value, OR (b) document the contract explicitly + add a spec asserting the chosen behavior.

Estimated: 30 min total. Bundle into a small follow-up PR before pushing to upstream review on TerriaJS#7835.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3Nice to have. Defer if needed.area: frontendFrontend: React, TerriaJS, admin dashboardtype: choreMaintenance, no behavior change

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions