Skip to content

Commit a743f52

Browse files
authored
Merge pull request #52 from bugsnag/update-errors-fix
Fix issue with updating multiple errors at once
2 parents 7b65783 + 2356829 commit a743f52

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
=========
33

4+
## 3.0.1 (27 January 2025)
5+
6+
### Fixes
7+
8+
* Fix issue with updating several errors at once
9+
| [#52](https://github.com/bugsnag/bugsnag-api-ruby/pull/52)
10+
411
## 3.0.0 (3 November 2022)
512

613
### Enhancements

lib/bugsnag/api/client/errors.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def update_errors(project_id, ids, operation, options = {})
4242
when String
4343
patch "projects/#{project_id}/errors/#{ids}", options.merge({:operation => operation})
4444
when Array
45-
defaults = {:operation => operation, :query => {:error_ids => ids.join(' ')}}
45+
defaults = {:operation => operation, :query => {:error_ids => ids}}
4646
merged_opts = deep_merge(defaults, options)
4747
patch "projects/#{project_id}/errors", merged_opts
4848
else

lib/bugsnag/api/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Bugsnag
22
module Api
3-
VERSION = "3.0.0"
3+
VERSION = "3.0.1"
44
end
55
end

spec/bugsnag/api/client/errors_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@
4242
end
4343

4444
it "updates and returns the updated errors" do
45-
errors = @client.update_errors @project_id, [@error_id], "fix", {:severity => "warn"}
45+
errors = @client.update_errors @project_id, [@error_id, @error_id], "fix", {:severity => "warn"}
4646
expect(errors.operation).to_not be_nil
4747
expect(errors[@error_id].status).to eq("fixed")
4848

49-
assert_requested :patch, bugsnag_url("/projects/#{@project_id}/errors?error_ids=#{@error_id}")
49+
assert_requested :patch, bugsnag_url("/projects/#{@project_id}/errors?error_ids[]=#{@error_id}&error_ids[]=#{@error_id}")
5050
end
5151
end
5252

0 commit comments

Comments
 (0)