Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bbarni2020
Copy link

@bbarni2020 bbarni2020 commented Aug 16, 2025

Summary by cubic

Updated the default API URL to Hack Club’s Hackatime endpoint so requests use the correct backend by default. This replaces the old Wakatime endpoint.

Summary by CodeRabbit

  • Chores
    • Updated the default API endpoint from WakaTime to Hack Club’s Hackatime. New users or those without a custom API URL will now connect to the Hackatime service by default.
    • Existing users with a previously set custom API URL are unaffected; their configuration remains intact.
    • No UI changes. If connectivity or data differences are observed, you can adjust the API URL in your settings.

@coderabbitai
Copy link

coderabbitai bot commented Aug 16, 2025

Walkthrough

The default API URL in src/lib/store.ts was updated from https://api.wakatime.com/api/v1 to https://hackatime.hackclub.com/api/hackatime/v1. No other logic, signatures, or control flow changed. Other stores and the createStore setup remain the same.

Changes

Cohort / File(s) Summary
Store default update
src/lib/store.ts
Changed default value of apiUrl store to https://hackatime.hackclub.com/api/hackatime/v1; no other modifications to stores or createStore logic.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

I nibbled the URL, a tiny tweak,
Hop to a new burrow, sleek and chic.
From Waka to Hacka, the paths realign,
Carrots cached, the endpoints fine.
Thump-thump—deploy! 🥕✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 1

🧹 Nitpick comments (1)
src/lib/store.ts (1)

29-32: Consider a one-time migration so existing users pick up the new default

Because the store uses a fallback only when no value exists, users who already have local:apiUrl set to the old default will keep it. If that’s undesired, add a simple migration that updates only untouched defaults (preserves custom user values).

Example (add near the export):

// Migrate users who never customized the API URL
const OLD_WAKA_URL = "https://api.wakatime.com/api/v1";
const NEW_HACKATIME_URL = "https://hackatime.hackclub.com/api/hackatime/v1";

// Reuse storage to directly read/update the item without affecting other stores.
const apiUrlItem = storage.defineItem<string>("local:apiUrl", { fallback: NEW_HACKATIME_URL });
apiUrlItem.getValue().then((current) => {
  if (current === OLD_WAKA_URL) {
    apiUrlItem.setValue(NEW_HACKATIME_URL);
  }
});

Optional: normalize user-inputted values (e.g., strip trailing slashes) if your endpoint construction is sensitive to them.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between fba17a3 and fc6f6b3.

📒 Files selected for processing (1)
  • src/lib/store.ts (1 hunks)
🔇 Additional comments (1)
src/lib/store.ts (1)

29-32: Updated default API base URL — LGTM

The new default aligns with the PR objective. No signature or control-flow impact.

Comment on lines 29 to 32
export const apiUrl = createStore(
"https://api.wakatime.com/api/v1",
"https://hackatime.hackclub.com/api/hackatime/v1",
"local:apiUrl"
);
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Ensure extension host permissions/CSP allow the new domain

If this runs in a browser extension or a constrained environment, verify:

Run this script to check for remaining references and required permissions:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Searching for old/new API domains across the repo..."
rg -n -C2 'api\.wakatime\.com|hackatime\.hackclub\.com'

echo
echo "Checking manifest/config for host permissions and connect-src..."
# Common manifest/config files; adjust globs if your repo uses different paths
fd -t f -i 'manifest*.json' -x rg -n -C2 -i 'host_permissions|connect-src|hackatime\.hackclub\.com|api\.wakatime\.com' {}
fd -t f -i 'wxt.config.*'    -x rg -n -C2 -i 'host_permissions|connect-src|hackatime\.hackclub\.com|api\.wakatime\.com' {}
fd -t f -i 'vite.config.*'   -x rg -n -C2 -i 'connect-src|hackatime\.hackclub\.com|api\.wakatime\.com' {}
fd -t f -i 'package.json'    -x rg -n -C2 -i 'hackatime\.hackclub\.com|api\.wakatime\.com' {}

echo
echo "Checking for potential double-appending of /api/v1 elsewhere..."
rg -n -C2 '/api/v1\b'

echo
echo "Scanning for uses of apiUrl to spot risky concatenations..."
rg -n -C2 '\bapiUrl\b'
rg -nP -C2 '\bget\s*\(\s*apiUrl\s*\)' --type ts --type svelte

Length of output: 2262


Verify extension CSP includes the new API domain

  • Host permissions in manifest.json already use <all_urls>, so https://hackatime.hackclub.com is permitted.

  • No occurrences of the old api.wakatime.com were found anywhere.

  • Add or update your content_security_policy in manifest.json to include the new origin under connect-src. For example:

     {
       …,
    -  "content_security_policy": "script-src 'self'; object-src 'self'"
    +  "content_security_policy": "script-src 'self'; object-src 'self'; connect-src https://hackatime.hackclub.com"
     }

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/lib/store.ts around lines 29 to 32 the API base URL was changed to
https://hackatime.hackclub.com/api/hackatime/v1; update your extension
manifest.json content_security_policy to allow that origin under connect-src.
Open manifest.json and add or append https://hackatime.hackclub.com (or its
origin https://hackatime.hackclub.com) to the connect-src directive so
fetch/XHR/websocket calls to the new API are permitted by the extension CSP;
ensure the CSP syntax matches your manifest version (MV2 vs MV3) and includes
any existing hosts.

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.

1 participant