boardgameio / boardgameio/p2p

State persistence

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
25
Forks
11
PR merge metrics
No merged PRs in 30d

Description

The `P2PHost` currently uses [an in-memory storage implementation](https://github.com/boardgameio/p2p/blob/f84a73aad94e19a564de0e3a5f0d98dd0ad2b498/src/db.ts) to hold match state. This means navigating, closing a tab, or just stopping/hiding the client will usually result in that state being lost.

We should use a persistent storage layer (e.g. using `localStorage` or `indexedDB`) and offer some options for how long matches should persist for as well as some way to delete matches.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked src/db.ts implementation to understand how P2PHost currently holds match state in memory. Define the persistence behavior, match-retention options, and deletion mechanism, then verify that state survives navigation, closing, stopping, or hiding the client and that matches can be removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.