This pull request includes several changes to improve the metrics management system and update the alt text reminder functionality. The most important changes include adding user ID hashing, modifying the metrics manager to handle existing data, and updating the alt text check queue to use a different identifier.
Metrics Management Improvements:
metrics.go: Added SHA-256 hashing for user IDs to enhance privacy. This includes a newhashUserIDfunction and modifications to theMetricEventstruct to store hashed user IDs. [1] [2] [3]metrics.go: Implemented theloadAndHashExistingDatafunction to load existing data and ensure all user IDs are hashed. This function is called during the initialization of theMetricsManager.metrics.go: Modified thesaveToFilemethod to include an optional locking mechanism to ensure thread safety.metrics.go: Moved therunmethod to the end of the file and reintroduced it with necessary changes to callsaveToFilewith locking.
Alt Text Reminder Update:
main.go: Changed thequeuePostForAltTextCheckfunction to usereplyPost.Account.IDinstead ofreplyPost.Account.Acctfor queuing alt text checks.
This pull request includes several changes to improve the metrics management system and update the alt text reminder functionality. The most important changes include adding user ID hashing, modifying the metrics manager to handle existing data, and updating the alt text check queue to use a different identifier.
### Metrics Management Improvements:
* [`metrics.go`](diffhunk://#diff-368a9e52513f8700cc50c424de862c537fc5c1a492c4598b97b960f46fc1c877L14-R16): Added SHA-256 hashing for user IDs to enhance privacy. This includes a new `hashUserID` function and modifications to the `MetricEvent` struct to store hashed user IDs. [[1]](diffhunk://#diff-368a9e52513f8700cc50c424de862c537fc5c1a492c4598b97b960f46fc1c877L14-R16) [[2]](diffhunk://#diff-368a9e52513f8700cc50c424de862c537fc5c1a492c4598b97b960f46fc1c877R32-R38) [[3]](diffhunk://#diff-368a9e52513f8700cc50c424de862c537fc5c1a492c4598b97b960f46fc1c877L70-R110)
* [`metrics.go`](diffhunk://#diff-368a9e52513f8700cc50c424de862c537fc5c1a492c4598b97b960f46fc1c877R50-R98): Implemented the `loadAndHashExistingData` function to load existing data and ensure all user IDs are hashed. This function is called during the initialization of the `MetricsManager`.
* [`metrics.go`](diffhunk://#diff-368a9e52513f8700cc50c424de862c537fc5c1a492c4598b97b960f46fc1c877L136-L154): Modified the `saveToFile` method to include an optional locking mechanism to ensure thread safety.
* [`metrics.go`](diffhunk://#diff-368a9e52513f8700cc50c424de862c537fc5c1a492c4598b97b960f46fc1c877R232-R245): Moved the `run` method to the end of the file and reintroduced it with necessary changes to call `saveToFile` with locking.
### Alt Text Reminder Update:
* [`main.go`](diffhunk://#diff-2873f79a86c0d8b3335cd7731b0ecf7dd4301eb19a82ef7a1cba7589b5252261L767-R766): Changed the `queuePostForAltTextCheck` function to use `replyPost.Account.ID` instead of `replyPost.Account.Acct` for queuing alt text checks.