Skip to content
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

Accelerated need to limit large url requests to “list records”, with alternative POST version #95

Closed
FredZhao-at opened this issue Dec 12, 2022 · 3 comments

Comments

@FredZhao-at
Copy link

FredZhao-at commented Dec 12, 2022

Hi! Fred here again, from the Airtable API team. Another update is that as part of recent infrastructure improvements to airtable.com, we needed to accelerate enforcement of rejecting any requests whose request URLs exceed 16k characters. The changes described below are in effect today.

  • Q: What endpoints does this affect?
    • The 16k character limit applies to all current and future API request URLs
    • Based on our internal audit of current usage, this primary impacts the “list records” endpoint, which is a GET request to /v0/{baseId}/{tableIdOrName} (https://airtable.com/developers/web/api/list-records)
  • Q: What is the impact of this change?
    • The vast majority of our API requests have remained well under the 16k character limit, and would not be affected
    • However, requests exceeding this limit will now be rejected, so we expect some calls to now require an update to handle the large cases. For example, requests whose query parameter for filterbyFormula is long enough to make the overall URL length to exceed that character limit
    • Therefore, we recommend either switching entirely to the alternative detailed below, or switching to it when you can detect that a request URL will exceed the 16k character limit
  • Q: What is the alternative?
  • Q: Why the urgency for this change?
    • I apologize for the inconvenience due to the accelerated timeline here. While we originally planned to start this enforcement in January 2023, we needed to deploy this change recently last week, as part of required infrastructure improvements to maintain the stability of our public API
@Meekohi
Copy link
Collaborator

Meekohi commented Dec 12, 2022

Thanks for the heads up Fred, I guess we'll see if anyone is impacted by this. I'm not developing on Airtable actively anymore, but if there's a need I might be able to carve out some time to make a PR.

@andruo11
Copy link

I ran into (I think) this issue today, while trying to find associated records from a parent row, maybe when there's a lot of child rows, kept getting 414 communication error which Mozilla says = URL too long.

@theblang
Copy link
Contributor

theblang commented Jan 5, 2023

@FredZhao-at Thanks so much for communicating this! I've put in a PR to switch the list-records call over to POST.

Tangentially related question, and I'll preface by saying it's really a moot question now that we're switching to POST. But I wanted to ask out of curiosity, because I thought the behavior was strange. Do you know of any special behavior regarding indexed vs non-indexed array params, ?foo[0]=0&foo[1]=1 vs ?foo[]=0&foo[]=1? I initially found this Github issue because our list-records call started failing with 422 Invalid request: parameter validation failed. Check your request data. after I increased the size of the fields param. I initially suspected maybe the length of the GET request was the problem, but it's well under 16k. Eventually I realized that this library is encoding array params as indexed with a note, "Airtable expects that arrays in query strings be encoded with indices." But the Airtable docs show non-indexed, so in my PR I switched the encoder back to the default Faraday one (which is non-indexed). Then the list-records call started working again! I think the number of fields that would trigger the issue was about 22 (it would work fine with less than that). It's also worth noting that this library is encoding spaces as %20 vs + (which the default Faraday one uses).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants