Skip to content
This repository was archived by the owner on Oct 2, 2025. It is now read-only.

Update TaskRatchet SDK#179

Merged
narthur merged 1 commit intomasterfrom
sdk-update
Sep 9, 2025
Merged

Update TaskRatchet SDK#179
narthur merged 1 commit intomasterfrom
sdk-update

Conversation

@narthur
Copy link
Collaborator

@narthur narthur commented Sep 9, 2025

This updates the TaskRatchet SDK dependency, hopefully fixing an issue with the web app using stale clerk auth tokens.

Summary by CodeRabbit

  • Bug Fixes
    • Improved authentication handling in the navigation bar, reducing intermittent sign-in issues and token-related errors.
  • Refactor
    • Updated authentication integration to use lazy token retrieval for better stability and compatibility.
  • Chores
    • Upgraded core SDK dependency to the latest major version for improved reliability and future compatibility.

Copilot AI review requested due to automatic review settings September 9, 2025 14:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the TaskRatchet SDK dependency from version 6.0.1 to 7.0.0 to resolve an issue with stale Clerk auth tokens in the web application.

  • Updates SDK dependency to leverage new authentication token handling mechanism
  • Refactors authentication token management to use a getter pattern instead of direct token setting

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
package.json Updates @taskratchet/sdk dependency from ^6.0.1 to ^7.0.0
src/components/organisms/NavBar.tsx Refactors auth token handling to use setAuthTokenGetter with async callback pattern
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

@narthur narthur temporarily deployed to sdk-update - tr-web PR #179 September 9, 2025 14:00 — with Render Destroyed
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 9, 2025

Walkthrough

Updated @taskratchet/sdk dependency to ^7.0.0 and refactored NavBar to use setAuthTokenGetter with an async token retrieval function instead of directly setting tokens.

Changes

Cohort / File(s) Summary
Dependency update
package.json
Bump @taskratchet/sdk from ^6.0.1 to ^7.0.0.
Auth token integration
src/components/organisms/NavBar.tsx
Replace setAuthToken usage with setAuthTokenGetter. Register async getter that returns null when not signed in or user missing; otherwise awaits clerk.session?.getToken() and returns token or null.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly conveys the primary change of updating the TaskRatchet SDK dependency, aligning with the main focus of the pull request without extraneous details.
Description Check ✅ Passed The description accurately summarizes the change to the SDK dependency and its intent to fix the stale Clerk auth token issue, making it relevant and on-topic.

Poem

A whisk of keys, a version hop—hooray!
I twitch my nose, the tokens come to play.
No more pushing treats, I fetch them when I may—
An async nibble, crisp as hay.
Ship it quick—then off to hop away! 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sdk-update

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Sep 9, 2025

Outdated dependencies

┌────────────────────────────────────────┬─────────────────┬───────────────┐
│ Package                                │ Current         │ Latest        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @clerk/themes                          │ 2.4.7           │ 2.4.18        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ dayjs                                  │ 1.11.13         │ 1.11.18       │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ vite (dev)                             │ 7.1.2           │ 7.1.5         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @clerk/clerk-react                     │ 5.41.0          │ 5.46.2        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @eslint/js (dev)                       │ 9.33.0          │ 9.35.0        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @stripe/stripe-js                      │ 7.8.0           │ 7.9.0         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @testing-library/jest-dom (dev)        │ 6.6.4           │ 6.8.0         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @typescript-eslint/eslint-plugin (dev) │ 8.39.1          │ 8.43.0        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @typescript-eslint/parser (dev)        │ 8.39.1          │ 8.43.0        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ eslint (dev)                           │ 9.33.0          │ 9.35.0        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ knip (dev)                             │ 5.62.0          │ 5.63.1        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ prettier (dev)                         │ 3.3.3           │ 3.6.2         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ query-string                           │ 9.2.2           │ 9.3.0         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @mui/icons-material                    │ 5.18.0          │ 7.3.2         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @mui/material                          │ 5.18.0          │ 7.3.2         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @mui/x-date-pickers                    │ 7.29.4          │ 8.11.1        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @types/node (dev)                      │ 22.17.1         │ 24.3.1        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @types/react (dev)                     │ 18.3.23         │ 19.1.12       │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @types/react-dom (dev)                 │ 18.3.7          │ 19.1.9        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @vitest/ui (dev)                       │ 2.1.9           │ 3.2.4         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ eslint-plugin-testing-library (dev)    │ 6.5.0           │ 7.6.8         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ globals (dev)                          │ 15.15.0         │ 16.3.0        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ jsdom (dev)                            │ 24.1.3          │ 26.1.0        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ react                                  │ 18.3.1          │ 19.1.1        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ react-dom                              │ 18.3.1          │ 19.1.1        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ react-router-dom                       │ 6.30.1          │ 7.8.2         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ react-toastify                         │ 10.0.6          │ 11.0.5        │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ rollup-plugin-visualizer (dev)         │ 5.14.0          │ 6.0.3         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ vitest (dev)                           │ 2.1.9           │ 3.2.4         │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ @mui/lab                               │ 5.0.0-alpha.173 │ 7.0.0-beta.17 │
├────────────────────────────────────────┼─────────────────┼───────────────┤
│ vitest-fetch-mock (dev)                │ 0.3.0           │ 0.4.5         │
└────────────────────────────────────────┴─────────────────┴───────────────┘

@github-actions
Copy link

github-actions bot commented Sep 9, 2025

Bundle Stats

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
5 1.75 MB → 1.75 MB (+21 B) +0.00%
Changeset
File Δ Size
node_modules/@taskratchet/sdk/dist/taskratchet-sdk.js 📈 +20 B (+0.66%) 2.96 kB → 2.98 kB
src/components/organisms/NavBar.tsx 📈 +1 B (+0.04%) 2.79 kB → 2.79 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
assets/index.js 492.04 kB → 492.07 kB (+21 B) +0.00%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
assets/dom.js 144.67 kB 0%
assets/material.js 636.95 kB 0%
assets/diffToNow.js 55.09 kB 0%
assets/DueForm.js 465.88 kB 0%

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/components/organisms/NavBar.tsx (1)

37-42: Prevent token staleness by skipping Clerk cache in the getter.

To further reduce stale-token risk, fetch a fresh token each time:

Apply:

-      return (await clerk.session?.getToken()) ?? null;
+      return (await clerk.session?.getToken({ skipCache: true })) ?? null;

Also consider moving the setAuthTokenGetter registration to the top-level app layout/provider if any SDK calls could occur before NavBar mounts, ensuring the getter is available ASAP.

📜 Review details

Configuration used: Repository: TaskRatchet/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8c9a65f and b8e4045.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json (1 hunks)
  • src/components/organisms/NavBar.tsx (2 hunks)
🔇 Additional comments (2)
package.json (1)

28-28: SDK v7 bump: lockfile locked, re-scan for old API

  • pnpm-lock.yaml correctly locks @taskratchet/sdk@7.0.0
  • Ripgrep default ignores skipped files; rerun with
    rg -nP -u "setAuthToken\s*\(" --glob "!.git/**" --glob "!node_modules/**"
    to confirm no old setAuthToken(...) usages remain.
src/components/organisms/NavBar.tsx (1)

14-14: Switch to setAuthTokenGetter aligns with SDK v7.

Import change matches the new API. No issues spotted.

@narthur narthur merged commit 25b51bb into master Sep 9, 2025
13 of 14 checks passed
@narthur narthur deleted the sdk-update branch September 9, 2025 18:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants