sanity-io / document-internationalization

Create unique translations of a document based on its language, joined by a shared reference document
MIT License
131 stars 38 forks source link

Using listener could lead to huge amount of API requests accounted in Usage metrics #155

Open sorokin-energi opened 1 year ago

sorokin-energi commented 1 year ago

Hi,

We noticed huge amount of API requests lately in the Usage stats. After some discussion with a community engineer at Sanity.io we found that it might be caused by /listen requests in the Studio (I guess editors just leave tabs open or something).

I dug it a bit more and found that in v1 useListenQuery is used.

Could/should such requests be counted at all? (I expected no requests from Studio will be counted, but it seems requests from plugins are counted). Does the plugin really need to use listen? Any suggestions how we can reduce count of requests? (We cannot migrate to v2 at the moment).

LiamMartens commented 11 months ago

@sorokin-energi as far as I know requests coming from the studio aren't being counted - I don't know about plugins though. I would have to check with @SimeonGriggs

sorokin-energi commented 10 months ago

@LiamMartens this ticket is kinda result of the investigation of the Community Engineer at Sanity.io. We were checking why our team exceeds API quotas considering quite a moderate amount of requests from the end customers and the most traffic was from this /listen endpoint.