Skip to content

Prevent number formatting in raw data retention period from causing unintended data deletion #25151

Description

@jmumby

Summary

The raw data retention setting under Privacy → Regularly delete old data from the database can accept a number containing thousands formatting.

For example, a German user may enter:

1.460

intending this to mean 1460 days.

Matomo can instead interpret this value as 1 day. If automatic deletion is enabled, this can result in almost all historical raw data being permanently deleted.

This is particularly problematic because the entered value appears reasonable to users in locales where a dot is commonly used as the thousands separator, while the resulting retention period is dramatically different and destructive.

Expected behavior

The retention-period input should only allow an unformatted whole number of days.

Any number formatting or thousands separators should be removed/normalized before the value is saved.

For example:

1460 → 1460
1.460 → 1460
1,460 → 1460

The stored retention value should therefore always be an integer representing the intended number of days.

Ideally, the UI should also make it clear that this field represents a number of days and prevent formatting from being introduced in the first place.

Why this is important

This setting controls permanent deletion of historical raw tracking data. Incorrectly interpreting a formatted number can therefore cause irreversible data loss.

A user intending to retain approximately four years of data by entering 1.460 can unintentionally configure Matomo to retain only one day.

Because of the destructive nature of this setting, Matomo should normalize the value and ensure that number formatting cannot alter the intended retention period.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementFor new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions