Fix Slack profile synchronization for HCA users - #1520
Merged
Conversation
Contributor
Greptile SummaryThe PR links eligible HCA users to their Slack identities and moves profile synchronization into independent GoodJob tasks.
Confidence Score: 5/5The PR appears safe to merge, with the changed authentication and background synchronization paths covered by focused tests. The HCA linking logic preserves existing links and uniqueness constraints, while Slack failures avoid corrupting stored profile data and stale users remain eligible for subsequent reconciliation. Important Files Changed
Sequence DiagramsequenceDiagram
participant HCA as HCA Authentication
participant User as User
participant Sync as SlackProfileSyncJob
participant Slack as Slack API
participant Sweep as SlackUsernameUpdateJob
HCA->>User: Authenticate and adopt unclaimed Slack ID
HCA->>Sync: Enqueue linked user
Sweep->>User: Find stale or never-synchronized users
Sweep->>Sync: Enqueue one job per user
Sync->>Slack: users.info with shared or personal token
alt Successful response
Slack-->>Sync: Profile data
Sync->>User: Persist username, avatar, and sync time
else HTTP 429
Slack-->>Sync: Retry-After
Sync->>Sync: Re-enqueue with backoff
else Other failure
Sync->>Sync: Report error without changing profile
end
Reviews (1): Last reviewed commit: "Fix Slack profile synchronization for HC..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary of the problem
Users authenticated through HCA can provide a Slack ID, but Hackatime did not adopt that ID or immediately synchronize the user's Slack profile. The existing nightly sync also processed only 100 users inline, so profile updates could remain stale for days and one failure could interfere with the sweep.
Describe your changes
SlackProfileSyncJobafter HCA authentication for linked usersRetry-AfterScreenshots / Media
N/A