chulkilee / ex_force

A Salesforce REST API wrapper for Elixir
https://hex.pm/packages/ex_force
MIT License
38 stars 27 forks source link

Add support for the new Tesla version #72

Open LeoLeiteSC opened 1 year ago

LeoLeiteSC commented 1 year ago

We updated the Tesla on our project to 1.6, and apparently this operation broke the ExForce dependency. We started to receive a decode error when executing the function ExForce.OAuth.get_token/2:

image

Tried with the version 1.5 as well and didn't worked. Tesla 1.4 worked as expected. Apparently the problem is with some change made in Tesla after the version 1.5.0.

roylez commented 1 year ago

This is because ex_force has gzip compression turned on, but when you send a accept-encoding with gzip to salesforce, the response does not contain a content-encoding header field required to trigger Tesla's Compression middleware, even though response body is indeed gzip compressed.

jotaviobiondo commented 9 months ago

Heyy, I work with @LeoLeiteSC and we have some updates about this issue.

The problem here is the ex_force defines the Tesla.Middleware.Compression BEFORE the JSON middleware, but it need to be defined AFTER, to follow this behavior:

Currently, it's doing the inverse.