Skip to content

fix: use transactionsHub endpoint so re-categorizations appear in CSV…#9

Open
CarterDunn wants to merge 1 commit into
cbangera2:mainfrom
CarterDunn:fix/hub-endpoint-categories
Open

fix: use transactionsHub endpoint so re-categorizations appear in CSV…#9
CarterDunn wants to merge 1 commit into
cbangera2:mainfrom
CarterDunn:fix/hub-endpoint-categories

Conversation

@CarterDunn

Copy link
Copy Markdown

Problem

GetTransactionsList (the fast bulk endpoint) returns stale categories — it serves Credit Karma's ML-inferred defaults and ignores any manual re-categorizations made in the CK UI.

Verified with a raw API dump: the same transaction URN returned "Transfer" from the list endpoint and "Travel & vacation" (the user's actual re-categorization) from the hub endpoint. The two endpoints returned different category.name values for the same transaction ID.

Fix

content.jsfetchTransactionsViaAPI() now uses fetchHistoricalTransactions() (the transactionsHub/GetTransactions endpoint — the same one CK's own transactions page uses) as primary source for the full date range. fetchRecentTransactions() (list endpoint) is demoted to a fallback with a console warning if the hub returns nothing.

popup.js — Added sendMessageWithInjection(): if the content script doesn't respond (page was open before the extension was installed/reloaded), it auto-injects content.js then retries. Eliminates the "make sure you are on Credit Karma and reload" error for most users.

popup.html — Added a "🔧 Debug: Export Raw API JSON" button that dumps raw responses from both GraphQL endpoints to a .json file — useful for diagnosing future category or field issues without reading network logs.

Trade-offs

  • Export is slower since the hub endpoint paginates vs. the list endpoint's single call. Page delay reduced 800 ms → 400 ms to partially offset.
  • The hub endpoint occasionally returns empty results for very old history; the list-endpoint fallback covers that case.

Testing

Confirmed a known re-categorized transaction exports with the correct user-set category rather than the ML-inferred default.

… export

GetTransactionsList returns stale categories - it serves Credit Karma's
ML-inferred defaults and ignores any manual re-categorizations made in the
CK UI. Verified with a raw API dump: the same transaction URN returned
Transfer from the list endpoint and the user-corrected category from the
hub endpoint.

Changes:
- content.js: fetchTransactionsViaAPI() now uses fetchHistoricalTransactions()
  (transactionsHub/GetTransactions - same endpoint CK's own page uses) as
  primary source for the full date range. fetchRecentTransactions() (list
  endpoint) demoted to fallback with a console warning. Page delay reduced
  800ms to 400ms to partially offset slower pagination.
- popup.js: Added sendMessageWithInjection() - auto-injects content.js if
  the content script is stale/missing, then retries. Eliminates most cases
  of the reload-the-page connection error. Added debug button handler.
- popup.html: Added Debug Export Raw API JSON button that dumps raw
  responses from both GraphQL endpoints for diagnosing future issues.
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