Stale ElectricSQL Shape Recovery

Recover stale ElectricSQL shapes after server restarts via API and TanStack DB error handlers.

Updated Dec 21, 2025
One-click install
npx skills add https://github.com/shotleybuilder/sertantai-legal --skill stale-electricsql-shape-recovery
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Stale ElectricSQL Shape Recovery
Source: https://github.com/shotleybuilder/sertantai-legal/tree/main/.claude/skills/stale-electric-shapes
Command: npx skills add https://github.com/shotleybuilder/sertantai-legal --skill stale-electricsql-shape-recovery

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the critical issue of ElectricSQL shapes becoming permanently broken after server restarts, preventing data synchronization.

Core Features & Use Cases

  • Detects and Recovers Broken Shapes: Identifies "offset out of bounds" errors caused by server restarts.
  • Automates Recovery: Implements client-side error handling and server-side API calls to reset and re-establish shapes.
  • Use Case: When your application's real-time data sync stops working after a deployment or server reboot, this skill ensures it automatically recovers without manual intervention.

Quick Start

Ensure the ElectricSQL integration testing flag is enabled in your development environment.

Frequently Asked Questions about Stale ElectricSQL Shape Recovery

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

FAQPage Schema
Why does ElectricSQL sync break with an offset out of bounds error after a server restart?

ElectricSQL shapes become stale and corrupted after server restarts because the client-side shape offset no longer matches the server's log, causing sync to permanently fail with an offset out of bounds error.

How do I recover stale ElectricSQL shapes automatically in my application?

To recover stale ElectricSQL shapes, implement client-side TanStack DB onError handlers for automatic retries and configure a server-side API to delete and reset broken shapes for seamless data flow restoration.

Can I use TanStack DB onError handlers to retry ElectricSQL shape synchronization?

Yes, you can implement client-side onError handlers in TanStack DB to automatically retry and recover ElectricSQL shapes when data synchronization stops working after a deployment or server reboot.

Does ElectricSQL shape recovery require both server-side and client-side configuration?

Yes, ElectricSQL shape recovery requires server-side configuration to enable a shape deletion API and client-side script adjustments to implement TanStack DB onError handlers for seamless data flow restoration.

What is the best way to delete corrupted ElectricSQL shapes after a deployment?

The best way to delete corrupted ElectricSQL shapes is to configure a server-side API endpoint that handles shape deletion, triggered automatically by client-side error handlers when sync failures occur.