Skip to content

ref: API key and transaction count queries - #656

Merged
rsproule merged 1 commit into
Merit-Systems:masterfrom
dhvll:bug-app-creationFlow
Nov 12, 2025
Merged

ref: API key and transaction count queries#656
rsproule merged 1 commit into
Merit-Systems:masterfrom
dhvll:bug-app-creationFlow

Conversation

@dhvll

@dhvll dhvll commented Nov 2, 2025

Copy link
Copy Markdown
Contributor

Fix: API Key Usage Detection in App Creation Flow

/claim #287

@dhvll
dhvll marked this pull request as draft November 2, 2025 13:15
@vercel

vercel Bot commented Nov 2, 2025

Copy link
Copy Markdown
Contributor

@dhvll is attempting to deploy a commit to the Merit Systems Team on Vercel.

A member of the Team first needs to authorize it.

@dhvll
dhvll marked this pull request as ready for review November 9, 2025 03:01
Comment on lines -28 to -34
const [transactionsCount] = api.apps.app.transactions.count.useSuspenseQuery(
{
appId,
},
{
refetchInterval: shouldRefetchTransactions ? 2500 : undefined,
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we removing transaction count here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(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.

@vercel

vercel Bot commented Nov 12, 2025

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
echo-control Ready Ready Preview Comment Nov 12, 2025 3:45pm

@rsproule rsproule left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@rsproule
rsproule merged commit e04e301 into Merit-Systems:master Nov 12, 2025
8 of 22 checks passed
@dhvll

dhvll commented Nov 12, 2025

Copy link
Copy Markdown
Contributor Author

thanks

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

Successfully merging this pull request may close these issues.

2 participants