ref: API key and transaction count queries - #656
Conversation
|
@dhvll is attempting to deploy a commit to the Merit Systems Team on Vercel. A member of the Team first needs to authorize it. |
| const [transactionsCount] = api.apps.app.transactions.count.useSuspenseQuery( | ||
| { | ||
| appId, | ||
| }, | ||
| { | ||
| refetchInterval: shouldRefetchTransactions ? 2500 : undefined, | ||
| } |
There was a problem hiding this comment.
why are we removing transaction count here?
There was a problem hiding this comment.
(Lines 45-52) and (Lines 28-34). Both queries were fetching the exact same data from the exact same endpoint!
Both queries would make separate API calls every 2.5 seconds.
The core bug: isConnected should only check if the connection is set up (OAuth tokens OR API keys exist), NOT whether transactions have been made.
If a user made transactions but deleted their API key, isConnected would still be true (wrong!)
The logic mixed two separate concepts: connection setup vs. usage
Different polling strategies for the same data caused race conditions
So kept second query.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
thanks |
Fix: API Key Usage Detection in App Creation Flow
/claim #287