objectbox / objectbox/objectbox-java

Improve DataObserver reference holding

オープン
#215 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

enhancement help wanted
主要言語
Java
スター
4.6k
フォーク
311
PR マージ指標
30日以内にマージされた PR はありません

説明

I'm trying to use obervable queries to detect when the user is logged in my application in order to start fetching data in background with correct authorization token.

    ...
    userBox.query().build().subscribe().observe(users -> fetchUserData());
    ...
    boxStore.subscribe(User.class).observe(class -> fetchUserData());

First "live" query doesn't work whilst the second works fine whenever I put(user) a new user in the userBox.

Is this correct? I'm not sure from which thread the user is being inserted, might this be an issue?
Does it make sense to use a "live" query to observe the insertion of new objects or is it just for changes in existing objects?
Live queries would be great, for my application and are the main feature that made me pick ObjectBox, hope I can get it working.

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

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

はじめの一歩

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

調査の方向性

まず、レポートで説明されている DataObserver と live-query のサブスクリプション経路を追跡し、それらを boxStore.subscribe(User.class) と比較します。クエリ参照がどのように保持されているか、またどのスレッドが挿入を処理するかを確認します。live query が新しく挿入されたユーザーを確実に監視し、その動作が明確化されるか適切なテストでカバーされれば完了です。

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

評価

技術スタック
java
領域
databases, mobile-dev
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

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

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