Still getting AggregateErrors after applying all the magic
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 12/100
- Type d'issue
- Bug
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- docker, nodejs, typescript
Piste de recherche
The report involves openid-client's request helper, the xero-node XeroClient constructor and its clock tolerance setting, plus the per-account locking and sequential token renewal in the consumer's code. No file in the repository is named as the fix point and the reporter's workaround is a sed patch to node_modules, so there is no clear first edit. Done would mean a reproducible cause for the AggregateError under concurrent clients, which needs maintainer input and is not a first-timer task.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
We are still occasionally and nowadays more frequently getting AggregateErrors from the xero api. xero-node is v4.11.3. Connections to all of our client accounts usually break when we get those.
-
Since xero-node is built on the openid-client but did not / do not support setting a timeout,
we increased the openid timeout and clock tolerance in our Docker container with a script as a post-processing step.
RUN sed -i "s/timeout: 2500/timeout: 20000/g" /code/node_modules/openid-client/lib/helpers/request.js
RUN sed -i "s/this.openIdClient[openid_client_1.custom.clock_tolerance] = 5;/this.openIdClient[openid_client_1.custom.clock_tolerance] = 100;/" /code/node_modules/xero-node/dist/XeroClient.js
We're also setting Xero.XeroClient() constructor's httpTimeout to 20000. -
We avoid creating many Xero.XeroClients using the singleton pattern, but we do create one XeroClient for each of the Xero Accounts we access.
-
We lock each Xero client while an operation is being executed.
To make 2. and 3. clear, for example when two of our clients Alice and Bob who have different Xero Accounts want to query their list of xero items, there will be two Xero.XeroClients running the query at the same time. However, if Candice, who is also in Bob's Xero Account wants to query something else, the XeroClient running Bob's query will be locked until Bob's query finishes, then it runs Candice's query.
So instead of having a single "über" XeroClient for all XeroAccounts and locking that (it would be too slow), we have a XeroClient per Xero Account and locking those. Not sure if this way of having XeroClients is still prone to the AggregateError -- the singleton pattern was proposed by a GitHub user to this specific error. -
Tokens for the accounts are renewed sequentially.
Can you please take a closer look or suggest any solution?
- Langage dominant
- TypeScript
- Étoiles
- 264
- Forks
- 177
- Merge moyen
- 10 h 5 min
- PR mergées (30 j)
- 5
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de XeroAPI/xero-node
-
`getClientCredentialsToken()` sends `scopes` (comma-joined) instead of the OAuth `scope` parameterOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
-
Difficulté 3/5 Une demi-journée Accessibilité débutants 55/100
-
TrackingOptionId value missing from accountingApi.getInvoices()Peut-être pris @miachillgood l’a pris il y a 152 jours. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 18/100
-
BankTransaction type is missing the batchPayment object.Peut-être pris @miachillgood l’a pris il y a 171 jours. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 22/100
-
Difficulté 3/5 1-2 jours Accessibilité débutants 25/100
Toutes les issues de XeroAPI/xero-node
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
super-productivity/super-productivity#12128 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
A docs change can fail pnpm check, because outreach lint and gen:types both write .astro/ at oncePeut-être pris @2389400626lh-ops l’a pris aujourd’hui. OuverteArea: Infrastructure Area: Outreach Bug Difficulty: Low Good First Issue Priority: Low
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
DouglasNeuroInformatics/OpenDataCapture#1956 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 1-3 heures Accessibilité débutants 72/100
justyns/silverbullet-ai#199 ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
spartan-ng/spartan#1931 ·
Les mainteneurs répondent en général sous 2 jours