gateway-cache-sync-keeper

Synchronize gateway payloads and caches across WebSocket event handling.

1.1k|250|Updated Aug 12, 2015
One-click install
npx skills add https://github.com/discord-php/DiscordPHP --skill gateway-cache-sync-keeper
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gateway-cache-sync-keeper
Source: https://github.com/discord-php/DiscordPHP/tree/main/.agents/skills/gateway-cache-sync-keeper
Command: npx skills add https://github.com/discord-php/DiscordPHP --skill gateway-cache-sync-keeper

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Maintain gateway event handlers — payload hydration, cache mutation, event return shapes, and handler registration. Use when touching WebSockets/Events, Handlers.php, or Event.php.

Core Features & Use Cases

  • Hydrate transport payloads into typed parts and update caches immediately.
  • Preserve event return shapes and ensure coherent data across users, channels, guilds, and messages.
  • Register and coordinate handlers to maintain cache synchronization when dispatch behavior or cache mutation changes.

Quick Start

Load this skill when touching gateway event handling to keep payloads, caches, and interfaces in real-time sync.

Frequently Asked Questions about gateway-cache-sync-keeper

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I keep Discord gateway events and cache repositories in sync?

To keep Discord gateway events and cache repositories in sync, hydrate transport payloads into typed parts and apply immediate cache mutations across WebSockets event handling for real-time coherence.

How do I hydrate WebSocket payloads into typed parts and update related caches?

Hydrate WebSocket payloads into typed parts by using runtime maps during event handling, which immediately updates related caches for users, channels, guilds, and messages to ensure coherent data.

Why does my Discord bot cache lose coherence after receiving gateway payloads?

Cache loses coherence after receiving gateway payloads when handler dispatch behavior fails to preserve event-shape invariants like last_message_id during payload hydration and cache mutation.

Can I preserve event return shapes and invariants like last_message_id for Discord messages?

Yes, you can preserve event return shapes and invariants like last_message_id by registering coordinated handlers that hydrate payloads using runtime maps and return meaningful values to listeners.

What is the best way to register handlers for Discord WebSocket cache synchronization?

The best way to register handlers for Discord WebSocket cache synchronization is coordinating them to maintain cache mutations and event return shapes whenever dispatch behavior changes across gateway events.

Do I need to update repositories and caches when touching Discord gateway event handlers?

Yes, you need to update repositories and caches when touching Discord gateway event handlers to ensure payloads, caches, and interfaces maintain real-time sync across users, channels, and guilds.