Closed martinopic closed 3 months ago
Hi! Thanks for noticing this issue.
At first glance, the simplest solution is to use POST-request to /v0/{baseId}/{tableIdOrName}/listRecords
route all the time, even for queries less than 16,000 chars. In that case we won't need any calculations here.
What do you think about it?
Yes, I agree, simpler solution.
Just a little doubt on why Airtable itself did not adopt the same unified approach but probably it's just for "historical reasons" (that is: they realized later on there could be the need for queries longer than 16.000 chars and offered this alternatives while maintaining the previous for API compatibility reasons.
Will you make the change yourself?
Thanks
Fixed in v1.0.1
All tests passes, so I hope there are no pitfalls here 😊
Hi,
I really appreciate your client and I would like to use it for a project but there is an edge case that is not handled: for record retrieval requests longer than 16,000 chars (e.g. when having lots of conditions or fields to retrieve) the GET will fail, the 16,000 GET request is an Airtable limit and the only possible documented workaround is to do the request as a POST with the parameters in the body
See https://airtable.com/developers/web/api/list-records :
I think this is something specific of
SelectQuery
so this code should go there. Unfortunately there is no way currently to know if the final URI will be > 16,000 chars so I think there are 2 ways:Client
provide this information adding agetBaseUri()
(which is what is missing to calculate the complete uri length) orgetCompleteUri(string $uri)
to Client orgetCompleteUriLength(string $uri)
method. This way the decision whether to switch to POST could be done transparently bySelectQuery
by looking at the final URI length.SelectQuery
If you are ok with any of these two methods (I think the first is more in line with the library) I can provide a patch.