Bug: date-time miscalculation in "HHhMMmSSs ago" #534

Open
opened 2025-11-20 04:24:46 -05:00 by saavagebueno · 0 comments
Owner

Originally created by @Marcool04 on GitHub (Jun 17, 2025).

TLDR: The interval provided as x in the "HHhMMmSSs ago" field can be miscalculated

  1. Is this urgent: No
  2. DNS provider(s) you use: OVH
  3. Program version: 2.9.0 (from AUR package https://aur.archlinux.org/packages/ddns-updater )
  4. What are you using to run the container: native compilation and execution
  5. Extra information:

On the following screenshot, notice how both the "no IP change for x" differ (and point to the correct time, see updates.json below), but "HHhMMmSSs ago" intervals are identical when they shouldn't be:

Image

updates.json:

{
  "records": [
    {
      "domain": "[hidden]",
      "owner": "@",
      "ips": [
        {
          "ip": "[hidden]",
          "time": "2025-04-21T18:10:44.391977471+02:00"
        },
        {
          "ip": "[hidden]",
          "time": "2025-06-15T12:45:21.789458327+02:00"
        }
      ]
    }
  ]
}

config.json:

{
  "settings": [
    {
      "provider": "ovh",
      "domain": "[hidden]",
      "username": "[hidden]",
      "password": "[hidden]",
      "ip_version": "ipv4",
      "ipv6_suffix": ""
    },
    {
      "provider": "ovh",
      "domain": "[hidden]",
      "mode": "api",
      "api_endpoint": "ovh-eu",
      "app_key": "[hidden]",
      "app_secret": "[hidden]",
      "consumer_key": "[hidden]",
      "ip_version": "ipv6",
      "ipv6_suffix": ""
    }
  ]
}

Host OS: Arch linux (up to date rolling release OS).

The problem is likely in this function: 20ac110753/internal/persistence/json/database.go (L114) but I can't really see how this might happen to be honest...

Thanks for the very useful little tool anyhow 👍

Cheers,

Mark.

Originally created by @Marcool04 on GitHub (Jun 17, 2025). **TLDR**: *The interval provided as x in the "HHhMMmSSs ago" field can be miscalculated* 1. Is this urgent: No 2. DNS provider(s) you use: OVH 3. Program version: 2.9.0 (from AUR package https://aur.archlinux.org/packages/ddns-updater ) 4. What are you using to run the container: native compilation and execution 5. Extra information: On the following screenshot, notice how both the "no IP change for x" differ (and point to the correct time, see updates.json below), but "HHhMMmSSs ago" intervals are identical when they shouldn't be: ![Image](https://github.com/user-attachments/assets/82f4084c-d51b-4e8e-bd1d-45f0d4576ce7) updates.json: ```log { "records": [ { "domain": "[hidden]", "owner": "@", "ips": [ { "ip": "[hidden]", "time": "2025-04-21T18:10:44.391977471+02:00" }, { "ip": "[hidden]", "time": "2025-06-15T12:45:21.789458327+02:00" } ] } ] } ``` config.json: ```json { "settings": [ { "provider": "ovh", "domain": "[hidden]", "username": "[hidden]", "password": "[hidden]", "ip_version": "ipv4", "ipv6_suffix": "" }, { "provider": "ovh", "domain": "[hidden]", "mode": "api", "api_endpoint": "ovh-eu", "app_key": "[hidden]", "app_secret": "[hidden]", "consumer_key": "[hidden]", "ip_version": "ipv6", "ipv6_suffix": "" } ] } ``` Host OS: Arch linux (up to date rolling release OS). The problem is likely in this function: https://github.com/qdm12/ddns-updater/blob/20ac11075322b1f0bee1f9b91913406777721ae8/internal/persistence/json/database.go#L114 but I can't really see how this might happen to be honest... Thanks for the very useful little tool anyhow 👍️ Cheers, Mark.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ddns-updater#534