Skip to content

Replace Socket.IO real-time sync with GraphQL subscriptions #105

Description

@0xdevcollins

Depends on: #100, Backend subscription implementation

The frontend uses Socket.IO (lib/socket/client.ts, hooks/use-socket-sync.ts, lib/query/sync/socket-sync.ts) for real-time bounty updates. The plan is to replace this with GraphQL subscriptions.

Note: This is blocked on the backend implementing bountyCreated, bountyUpdated, bountyDeleted subscriptions.

Tasks

  • Install graphql-ws client package
  • Create lib/graphql/subscriptions.ts with subscription documents
  • Create a useGraphQLSubscription wrapper hook that subscribes and invalidates React Query cache
  • Replace useSocketSync with the new subscription-based sync
  • Remove lib/socket/client.ts, lib/query/sync/socket-sync.ts, lib/query/sync/handlers.ts
  • Remove socket.io-client dependency from package.json

Acceptance Criteria

  • Real-time updates work via GraphQL subscriptions
  • All Socket.IO code is removed
  • socket.io-client is no longer a dependency

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions