AcevedoR / AcevedoR/rpg-maestro

Cloud-readiness: session writes need transactions or optimistic concurrency

オープン
#115 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
TypeScript
スター
0
フォーク
0
平均マージ
16分
マージ済み PR(30日)
7

説明

## Problem

Session playback state is updated with a read-modify-write against Firestore with no transaction and no version check.

- `apps/rpg-maestro/src/app/sessions/sessions.service.ts` — `upsertCurrentTrack` / `upsertShortEffectTrack` read, mutate, then write

Running a single instance made this safe by accident. With two instances — or a single maestro driving the session from two devices — concurrent track changes can clobber each other, and the last writer wins with no detection.

## Proposed rework

- Wrap the read-modify-write in a Firestore transaction, or
- Add optimistic concurrency: a `version` field on the session, written with a conditional update, retried on conflict

Either way the API should be able to tell the caller that its change lost a race, instead of silently dropping it.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

The issue points to `apps/rpg-maestro/src/app/sessions/sessions.service.ts` and the `upsertCurrentTrack` and `upsertShortEffectTrack` methods. Start by examining how these methods read, mutate, and write session state to Firestore. Research Firestore transactions or optimistic concurrency using a `version` field. The goal is to wrap the updates to prevent race conditions and return a conflict error to the caller.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
firebase, typescript
領域
backend, databases
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
明確に書かれている
初心者へのやさしさ
65/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。