Skip to content

fix(slack): add channels:join scope and fix zero-value last_sync bug#53

Merged
yashrastogi merged 3 commits into
mainfrom
fix/slack-sync-scope-fix
Apr 29, 2026
Merged

fix(slack): add channels:join scope and fix zero-value last_sync bug#53
yashrastogi merged 3 commits into
mainfrom
fix/slack-sync-scope-fix

Conversation

@yashrastogi
Copy link
Copy Markdown
Collaborator

Summary

  • Add channels:join OAuth scope so bot auto-joins public channels after install (no manual /invite needed)
  • Fix fresh-install sync bug: when last_sync is unset (0), omit the oldest parameter instead of passing "0.000000" which Slack rejects with invalid_ts_oldest
  • Add SlackClient unit tests (mock HTTP client) — requires HTTPDoer interface on SlackClient

Changes

File Change
services/slack.go Extract HTTPDoer interface for testability
services/sync.go Guard oldest param: only pass when lastSync > 0
handlers/integrations.go Add channels:join to OAuth scope string
services/slack_client_test.go 22 tests covering channels, messages, users, OAuth, webhook validation, rate limits

Test plan

  • All 22 Slack unit tests pass
  • Full go test ./... passes
  • Real Slack workspace verified: OAuth flow, GetChannels, GetMessages, PostMessage, SyncSlackSignals

Two fixes for Slack integration:
- Add channels:join OAuth scope so bot auto-joins public channels on install
- Fix fresh-install sync: when last_sync is unset (0), omit the oldest
  parameter instead of passing "0.000000" which Slack rejects with
  invalid_ts_oldest, blocking all message sync
- Add SlackClient test coverage with mock HTTP client (requires HTTPDoer
  interface on SlackClient for testability)

Closes: real Slack integration testing
Fix alignment in table-driven test structs and map literals.
@yashrastogi yashrastogi merged commit f154008 into main Apr 29, 2026
1 check passed
@yashrastogi yashrastogi deleted the fix/slack-sync-scope-fix branch April 29, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant