fix: skip cross-workspace user collisions during bot sync - #132
Closed
steipete wants to merge 1 commit into
Closed
Conversation
USLACKBOT exists in every Slack workspace and Slack Connect can surface externally owned members, so the trailing users snapshot aborted any multi-workspace archive sync once another workspace had recorded the user. Demote the collision to a skip-with-warning, matching the channel fix from #130 and the desktop import path; all other upsert errors stay fatal.
Collaborator
Author
|
Closing as a duplicate subset of #131, which fixes the same users-snapshot collision ( |
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.
What Problem This Solves
Bot syncs of a multi-workspace archive abort at the trailing users snapshot: Slack's built-in slackbot has the literal ID
USLACKBOTin every workspace, so the first workspace to record it owns the row and every later workspace's sync exits withWorkspaceCollisionError. Slack Connect can surface externally owned members the same way. Messages import fine; the run still ends nonzero and the workspace sync-state stamp is never written.Why This Change Was Made
#130 fixed exactly this failure class for channels (Slack Connect shared channels) by demoting the collision to a skip-with-warning at the API sync boundary. The users snapshot was the missed sibling surface; the desktop import path (
upsertDesktopUser) already tolerates user collisions the same way. The first workspace keeps the user row; all other upsert errors stay fatal.User Impact
Multi-workspace archives sync cleanly again. Live repro: a Foundation-workspace bot sync on a database that also holds a desktop import of another workspace imported all messages but exited nonzero on
USLACKBOTevery run.Evidence
TestSyncSkipsUserOwnedByAnotherWorkspace: seedsUSLACKBOTunder another workspace, proves the sync completes, the original workspace keeps the row, other users still sync, and channel messages persist.GOWORK=off go test ./...green;make lint(vet + govulncheck) clean.