[PR #306] [MERGED] refactor: simplify GitHub age gate cache #318

Closed
opened 2026-02-15 17:16:53 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/openclaw/clawhub/pull/306
Author: @steipete
Created: 2/14/2026
Status: Merged
Merged: 2/14/2026
Merged by: @steipete

Base: mainHead: refactor/github-id-cleanups


📝 Commits (2)

  • 6a52d9f refactor(convex): drop githubFetchedAt + extract github identity
  • 7aa9e05 docs: clarify GitHub-only auth

📊 Changes

8 files changed (+46 additions, -51 deletions)

View changed files

📝 convex/_generated/api.d.ts (+2 -0)
convex/githubIdentity.ts (+9 -0)
📝 convex/lib/githubAccount.test.ts (+9 -18)
📝 convex/lib/githubAccount.ts (+22 -15)
📝 convex/schema.ts (+0 -1)
📝 convex/users.ts (+3 -16)
📝 docs/auth.md (+1 -0)
📝 docs/security.md (+0 -1)

📄 Description

  • Remove unused githubFetchedAt field (no TTL anymore)
  • Move GitHub providerAccountId lookup into dedicated module
  • Keep age gate logic small + tested

Tests: bun run lint; bun run test

Greptile Overview

Greptile Summary

This PR simplifies the GitHub account age gate caching by removing the unused githubFetchedAt field (no TTL logic depends on it) and extracting the GitHub providerAccountId lookup into a dedicated convex/githubIdentity.ts module. The mutation is renamed from updateGithubMetaInternal to setGitHubCreatedAtInternal to better reflect its narrowed responsibility.

  • Removed githubFetchedAt from the schema, all mutations, delete-account cleanup, and docs
  • Moved getGitHubProviderAccountIdInternal from convex/users.ts to convex/githubIdentity.ts, co-locating it with the existing canHealSkillOwnershipByGitHubProviderAccountId helper in convex/lib/githubIdentity.ts
  • Extracted assertGitHubNumericId and buildGitHubHeaders as private helpers in convex/lib/githubAccount.ts
  • All callers, tests, mocks, and documentation updated consistently with no stale references

Confidence Score: 5/5

  • This PR is a safe, mechanical refactor that removes dead code and improves module organization with no behavioral changes.
  • All references to removed fields and renamed functions have been updated consistently. No stale references remain in the codebase. The logic is unchanged — only the structure and naming are improved. Tests are updated to match the new API shape and cover the same scenarios.
  • No files require special attention.

Last reviewed commit: 7aa9e05

Context used:

  • Context from dashboard - AGENTS.md (source)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/openclaw/clawhub/pull/306 **Author:** [@steipete](https://github.com/steipete) **Created:** 2/14/2026 **Status:** ✅ Merged **Merged:** 2/14/2026 **Merged by:** [@steipete](https://github.com/steipete) **Base:** `main` ← **Head:** `refactor/github-id-cleanups` --- ### 📝 Commits (2) - [`6a52d9f`](https://github.com/openclaw/clawhub/commit/6a52d9fa10da635ac6a617636e09ab774bbf9cbd) refactor(convex): drop githubFetchedAt + extract github identity - [`7aa9e05`](https://github.com/openclaw/clawhub/commit/7aa9e05a1af7135a388905de4ca3aabc879dd1b9) docs: clarify GitHub-only auth ### 📊 Changes **8 files changed** (+46 additions, -51 deletions) <details> <summary>View changed files</summary> 📝 `convex/_generated/api.d.ts` (+2 -0) ➕ `convex/githubIdentity.ts` (+9 -0) 📝 `convex/lib/githubAccount.test.ts` (+9 -18) 📝 `convex/lib/githubAccount.ts` (+22 -15) 📝 `convex/schema.ts` (+0 -1) 📝 `convex/users.ts` (+3 -16) 📝 `docs/auth.md` (+1 -0) 📝 `docs/security.md` (+0 -1) </details> ### 📄 Description - Remove unused githubFetchedAt field (no TTL anymore) - Move GitHub providerAccountId lookup into dedicated module - Keep age gate logic small + tested Tests: bun run lint; bun run test <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR simplifies the GitHub account age gate caching by removing the unused `githubFetchedAt` field (no TTL logic depends on it) and extracting the GitHub `providerAccountId` lookup into a dedicated `convex/githubIdentity.ts` module. The mutation is renamed from `updateGithubMetaInternal` to `setGitHubCreatedAtInternal` to better reflect its narrowed responsibility. - Removed `githubFetchedAt` from the schema, all mutations, delete-account cleanup, and docs - Moved `getGitHubProviderAccountIdInternal` from `convex/users.ts` to `convex/githubIdentity.ts`, co-locating it with the existing `canHealSkillOwnershipByGitHubProviderAccountId` helper in `convex/lib/githubIdentity.ts` - Extracted `assertGitHubNumericId` and `buildGitHubHeaders` as private helpers in `convex/lib/githubAccount.ts` - All callers, tests, mocks, and documentation updated consistently with no stale references <h3>Confidence Score: 5/5</h3> - This PR is a safe, mechanical refactor that removes dead code and improves module organization with no behavioral changes. - All references to removed fields and renamed functions have been updated consistently. No stale references remain in the codebase. The logic is unchanged — only the structure and naming are improved. Tests are updated to match the new API shape and cover the same scenarios. - No files require special attention. <sub>Last reviewed commit: 7aa9e05</sub> <!-- greptile_other_comments_section --> **Context used:** - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=a1d58d20-b4dd-4cbb-973a-9fd7824e1921)) <!-- /greptile_comment --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 17:16:53 -05:00
yindo closed this issue 2026-02-15 17:16:53 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/clawhub#318