Prevent Duplicate Metric Usage Reports by Adding Daily Payload Hashing #531 #542
+286
−16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
Reference to Existing Issue
Closes #531 .
Please open a new issue if there isn't an existing issue yet.
Description of Changes
This pull request introduces a reliable mechanism to ensure that metric usage data is sent only once per day, addressing the issue of duplicate submissions caused by repeated executions in certain Django configurations.
To achieve this, the system now generates a hash of the daily metric payload and stores it along with the current date. When metrics are generated again on the same day, the stored hash is compared with the new one. If the payload is unchanged, the system simply skips the transmission. This prevents unnecessary duplication while keeping the reporting behavior consistent and lightweight.
In addition to the core logic, the following updates have been made:
-Added a persistent storage step for recording the daily payload hash.
-Implemented comparison logic to detect and prevent repeated submissions within the same day.
-Added and updated test cases to validate the new behavior, including hash creation, daily checks, and skip conditions.
-Updated the documentation to clearly explain the new flow and provide guidance on correct configuration.
Screenshot
This change does not modify any user-facing interface, so no screenshot is required.