-
Notifications
You must be signed in to change notification settings - Fork 77
Open
Labels
Description
Client library should always take context as a first argument of every function using http client or similar. Reason is simple if there is anything in way between client and intercom server it can go forever keeping whatever is using it blocked forever (not really that uncommon).
This would be expected behavior.
ctx, cancel := context.WithCancel(context.Background())
cancel()
_, err := ic.Users.Save(ctx, &user)
// err == context.Canceled luckily this can be solved by patching http client for now. But I suggest new release v3 supporting context as every good library does to avoid patching intercom's http client. Or to avoid new release there is an option to add postfix ...Ctx() to every method using http client.
Example:
_, err := ic.Users.SaveCtx(ctx, &user)Reactions are currently unavailable