-
Notifications
You must be signed in to change notification settings - Fork 20
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
fix(retry): BaseRetryHandler + Make Retry in general easier to play with #88
Conversation
} | ||
|
||
protected _getPayloadOptions(): { options?: PayloadOptions } { | ||
if (typeof this._options.minIdLength === 'number') { |
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.
noob typescript question here: if _options
is typed as an Options
, why specifically check if minIdLength
is a number? Or is this a roundabout way of making sure it's not null?
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.
minIdLength
is by default null
since it's typed as null | number
- if it's not defined, I think it would be better for the HTTP API to decide what the "correct" min ID length is
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.
1 nit, else LGTM 👍
@@ -2,11 +2,16 @@ import { Event } from './event'; | |||
import { Response } from './response'; | |||
|
|||
/** Layer used to send data to Amplitude while retrying throttled events in the right order. */ | |||
export interface RetryClass { | |||
export interface Retry { |
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.
We should remove RetryClass
references from README.md
https://github1s.com/amplitude/Amplitude-Node/blob/273/retry-override/packages/node/README.md
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.
makes a lot of sense, ty! will change
788939b
to
3a9a750
Compare
Summary
Begins to address issues highlighted by #86 :
exports
Retry
directly form@amplitude/node
so that a second dep isn't necessaryexports
BaseRetryHandler
that makes it easier to set up a default transport, etc.exports
DefaultTransport
Exports
RetryClass
->Retry
in the@amplitude/types
module to avoid confusion as this is an interface to implement and not a Class in itself. deprecating and still exportingRetryClass
to avoid breaking changes (for now).Checklist