Skip to content

Connect GamerZ Hub Database Load to Appwrite & 15-Game Capability Expansion - #37

Merged
omharde42 merged 1 commit into
mainfrom
feat/appwrite-db-load-integration-12713316917790388748
Sep 12, 2026
Merged

omharde42 merged 1 commit into
mainfrom
feat/appwrite-db-load-integration-12713316917790388748

Conversation

@omharde42

Copy link
Copy Markdown
Owner

Integrate Appwrite server SDK (node-appwrite) to handle high-read database workloads (game registry, public gamer profiles, game profiles, teammate discovery) with PostgreSQL/Supabase write-through synchronization and automatic fallback. Expand canonical game registry and capability adapter architecture to 15 games.


PR created automatically by Jules for task 12713316917790388748 started by @omharde42

Co-authored-by: omharde42 <193398705+omharde42@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI lite review requested due to automatic review settings September 12, 2026 15:27
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 3eab5968-3dc2-4071-a81e-2fcc908e3071


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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

return {
gameId: game.gameId,
joinCapability: 'ROOM_CODE',
instructions: `1. Open ${game.displayName}.\n2. Select Private/Custom Room mode.\n3. Enter Room ID: ${sessionData.roomCode} ${sessionData.roomPassword ? `and Password: ${sessionData.roomPassword}` : ''}.`,
return {
gameId: game.gameId,
joinCapability: 'ROOM_CODE',
instructions: `1. Open ${game.displayName}.\n2. Select Private/Custom Room mode.\n3. Enter Room ID: ${sessionData.roomCode} ${sessionData.roomPassword ? `and Password: ${sessionData.roomPassword}` : ''}.`,
joinCapability: 'ROOM_CODE',
instructions: `1. Open ${game.displayName}.\n2. Select Private/Custom Room mode.\n3. Enter Room ID: ${sessionData.roomCode} ${sessionData.roomPassword ? `and Password: ${sessionData.roomPassword}` : ''}.`,
roomCode: sessionData.roomCode,
roomPassword: sessionData.roomPassword || null,

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7221237ca0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

);
}

return {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Persist game session state before reporting success

createOrFindSession only constructs and returns an object; it never stores the session anywhere. Consequently, every newly exposed session route operates on arbitrary IDs: join requests disappear immediately, hosts cannot retrieve or approve real requests, and any authenticated caller can mark a fabricated request/session accepted or completed. Persist the session and request records and load them with host/participant authorization before returning success.

Useful? React with 👍 / 👎.

Comment on lines +198 to +200
const profiles = await prisma.profile.findMany({
take: parsedLimit,
where: req.user?.userId ? { userId: { not: req.user.userId } } : {},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Apply discovery filters to the PostgreSQL fallback

When Appwrite is unavailable or its cache is cold, this fallback ignores every requested rank, playstyle, language, and availability filter; it only excludes the caller. Thus requests such as ?rank=HEROIC&language=HINDI return the highest-scoring profiles regardless of the supplied criteria, while the Appwrite path applies those filters. Add the same predicates to the Prisma query before caching and returning candidates.

Useful? React with 👍 / 👎.

Comment on lines +58 to +60
const cachedRegistry = await appwriteService.getGameRegistry();
if (cachedRegistry && Object.keys(cachedRegistry).length > 0) {
return sendSuccess(res, Object.values(cachedRegistry), 'Canonical game registry fetched via Appwrite read model');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Populate the registry cache atomically

This treats any nonempty Appwrite registry as complete, but the fallback below starts one unawaited write per game. After the first write succeeds and before the rest do (or if some fail), the next request returns only that partial subset and never falls back to the full canonical registry. The equivalent condition exists on /api/game/registry as well, so both registry APIs can intermittently hide supported games.

Useful? React with 👍 / 👎.

borderColor: 'border-yellow-500/40',
},
{
id: 'clashofclans',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep catalog IDs aligned with connection-state mapping

Existing connected Clash of Clans, Brawl Stars, and Clash Royale accounts are normalized by PopularGamesModal to clash_of_clans, brawl_stars, and clash_royale, but the changed catalog now uses the unseparated IDs. Therefore connectedGameIds.has(game.id) is false for these accounts, so the catalog no longer labels them connected and lets the user select a duplicate connection flow. Update the unchanged normalization/mapping consumers or retain compatible catalog IDs.

Useful? React with 👍 / 👎.

@omharde42
omharde42 merged commit 7cf3ce2 into main Sep 12, 2026
7 of 8 checks passed
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.

3 participants