-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
bug[issue] bug[issue] bug
Description
Bug Description
The PublishView
method incorrectly handles empty hash parameters, causing hash_conflict
errors for all home tab updates.
Problem
When calling client.PublishView(userID, view, "")
with an empty hash string, the library sends:
{"hash": ""}
According to Slack API docs, to ignore hash validation, the hash field should be omitted entirely from the JSON payload.
Current Behavior
- All
PublishView
calls fail withhash_conflict
error - Home tab views cannot be updated
Expected Behavior
- Empty hash string should omit the
hash
field from JSON PublishView
should work without hash validation
Code Location
/views.go
line ~X (PublishView method)
Workaround
Use PublishViewContext
with Hash: nil
:
client.PublishViewContext(context.Background(), slack.PublishViewContextRequest{
UserID: userID,
View: view,
Hash: nil, // Properly omits hash field
})
Suggested Fix
In PublishView
method, check if hash is empty and set to nil:
var hashPtr *string
if hash != "" {
hashPtr = &hash
}
Environment
- Library version: v0.17.1
- Go version: 1.24.6
illuher
Metadata
Metadata
Assignees
Labels
bug[issue] bug[issue] bug