Skip to content

Connect GamerZ Hub database read load to Appwrite with verified fallback and sync - #38

Merged
omharde42 merged 1 commit into
mainfrom
feat/appwrite-db-load-offloading-11988241612304523473
Sep 14, 2026
Merged

omharde42 merged 1 commit into
mainfrom
feat/appwrite-db-load-offloading-11988241612304523473

Conversation

@omharde42

Copy link
Copy Markdown
Owner

Integrates Appwrite Cloud database read models for game registry, public gamer profiles, game profiles, and teammate discovery into the GamerZ Hub Express backend. Includes write-through sync from PostgreSQL/Supabase, resilient fallback logic on miss/error, and unit tests verifying end-to-end operation.


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

…allbacks

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 14, 2026 06:58

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.

@coderabbitai

coderabbitai Bot commented Sep 14, 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: b5881133-54c6-4794-ae5f-48d7a6948511


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.

@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: 992b48b551

ℹ️ 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".

Comment on lines +126 to +127
userId,
gameId: 'freefire',

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 Use an Appwrite-valid ID for Free Fire discovery documents

For the normal User.id values generated by this schema (36-character UUIDs), syncTeammateDiscovery derives the Appwrite document ID as freefire_${userId}, which is 45 characters. Appwrite custom document IDs are capped at 36 characters, so both the update and create attempts fail and are swallowed by the best-effort sync; with Appwrite configured, this new Free Fire read model will therefore never be populated.

Useful? React with 👍 / 👎.

Comment on lines +66 to +67
userId,
game: 'STEAM',

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 Use an Appwrite-valid ID for Steam profile documents

The game-profile sync derives its Appwrite document ID as ${userId}_${game}. Since production userIds are 36-character UUIDs, the STEAM suffix produces a 42-character ID, exceeding Appwrite's 36-character custom-ID limit. The rejected update/create calls are caught by the sync service, so every Steam sync silently misses the Appwrite read model.

Useful? React with 👍 / 👎.

Comment on lines +163 to +167
return filteredCached.map(candidate => {
const matchDetails = this.calculateCompatibility(currentUserProfile, candidate);
return {
profile: {
userId: candidate.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 Refresh cached teammates after reputation updates

Once Appwrite has any matching document, this early return skips both the PostgreSQL query and the lazy synchronization loop. rateTeammate updates FreeFireProfile.reputationScore only in PostgreSQL, so a rating submitted after a candidate has been cached leaves that candidate's cached reputation—and therefore its compatibility score and trust reason—stale indefinitely until that candidate updates their profile again.

Useful? React with 👍 / 👎.

@omharde42
omharde42 merged commit d2cdfe8 into main Sep 14, 2026
7 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.

2 participants