Removed entity is blocking creating another entity with the same id

オープン
#3,670 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
rust, typescript
領域
backend, databases

調査の方向性

src/ethereum.mapping.ts での再現から始め、特に handleCreateSplitCall、User.load、store.remove、Split.save を確認してください。共有インターフェースのケースを再現し、エンティティの削除と置換がどのように処理されるかを追跡してください。このシーケンスのカバレッジを用意し、削除された User が同じ ID の Split の作成をブロックしなくなれば完了です。

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

説明

bug

Do you want to request a feature or report a bug?
Report a bug

What is the current behavior?
I have two entity types with a shared interface, Split and User. When I go to create a new Split entity, I check to see if a User entity exists with the same id, and if yes I remove it first. I then create the split entity with that id. However, I am getting the following error:

Subgraph writer failed, error: tried to set entity of type 'Split' with ID "0xf8843981e7846945960f53243ca2fd42a579f719" but an entity of type 'User', which has an interface in common with 'Split', exists with the same ID

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
The error is occurring on this subgraph: https://thegraph.com/hosted-service/subgraph/0xsplits/splits-subgraph-kovan?version=pending

You can view the code here: https://github.com/0xSplits/splits-subgraph/blob/master/src/ethereum.mapping.ts#L99

A condensed version of it looks like:

export function handleCreateSplitCall(call: CreateSplitCall): void {
  let splitId = call.outputs.split.toHexString();

  let splitUserId = User.load(splitId);
  if (splitUserId) store.remove("User", splitId)
  
  let split = new Split(splitId);
  split.save();

What is the expected behavior?
I would expect the split to be successfully created since the user entity with the same id was removed before the split was saved.

主要言語
Rust
スター
3.2k
フォーク
1.1k
平均マージ
4日 1時間
マージ済み PR(30日)
1

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

graphprotocol/graph-node のほかの issue

graphprotocol/graph-node の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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