-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add request_id option to client #133
Changes from 1 commit
a6a0946
fef93a1
67d06b8
1fc2ef8
5d3666c
1670bb1
9357a13
55f18aa
a1f71d4
d39e11c
d9b6b8f
3e55b9e
a061d3b
c227120
890ced2
97febef
dc6f216
844a938
a7f1e29
66259dc
21da79c
aca07ad
f5cfc0f
f99e186
4159c51
c2478be
daacf46
44d08b7
d531f5a
24435b8
4425fb8
756b266
72eda17
3308586
39a9b75
eb87ad6
f0e3730
8efa111
a34000f
df94980
2731ca7
528c92a
7399f18
48c6cfc
c2ab83c
705f143
0b33cdd
8b87e5f
749d49c
e17125c
0774a2d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -470,9 +470,9 @@ def send_request(method, path, params, options) | |
end | ||
case error | ||
when Faraday::TimeoutError | ||
raise Ably::Exceptions::ConnectionTimeout.new(error.message, nil, 80014, error, {}, random_request_id) | ||
raise Ably::Exceptions::ConnectionTimeout.new(error.message, nil, 80014, error, {request_id: random_request_id}) | ||
when Faraday::ClientError | ||
raise Ably::Exceptions::ConnectionError.new(error.message, nil, 80000, error, {}, random_request_id) | ||
raise Ably::Exceptions::ConnectionError.new(error.message, nil, 80000, error, {request_id: random_request_id}) | ||
else | ||
raise error | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One of the errors they want to correlate was the nonce value one, which'll be in this branch, that also needs the requestId set. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am also not keen on a var called |
||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spacing issues again, here and many times below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not a big fan of this.
random_request_id
is defined in line 445, yet is within a conditional. I realise Ruby allows this sort of thing, but it's messy and error prone. Why are you definingrandom_request_id
as a varaiable when you have access to theparams
variable in this scope which is available anyway?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact, I am not sure I have seen a test that confirms that a) a request is sent to Ably with a
request_id
, b) it fails (intentionally), c) the test confirms that the exception raised has that SAMErequest_id
, d) the Logger is showing therequest_id
in the output. This is the crux of what we're doing here. Given this code path, I fear our tests so far are just testing that arequest_id
is present, but not ensuring it is consistent throughout.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense, but I am struggling a bit to inspect the url of a request, say
client.stats
. Any suggestion?