microsoftgraph / microsoftgraph/msgraph-sdk-java

Proguard rules needed for PageIterator

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

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

type:enhancement
主要言語
Java
スター
444
フォーク
154
平均マージ
18時間 28分
マージ済み PR(30日)
4

説明

Describe the bug

On Android with a minified build, an exception occurs with PageIterator over DriveItems. The PageIterator class calls getDeclaredMethod("getValue") on the response class. The response getValue method appears to be removed by the minified build.

Exception:

java.lang.IllegalAccessException: NO_COLLECTION_PROPERTY_ERROR
at com.microsoft.graph.core.tasks.PageIterator.extractEntityListFromParsable(PageIterator.java:300)
at com.microsoft.graph.core.tasks.PageIterator$Builder.build(PageIterator.java:203)
at com.microsoft.graph.core.tasks.PageIterator$Builder.build(PageIterator.java:210)
Expected behavior

Proguard rules provided by the library would include the needed classes/methods for PageIterator to work.

How to reproduce

Code:

var resp = 
        client.drives().byDriveId(driveId).items().byDriveItemId("root").children().get();

var pageIter =
        new PageIterator.Builder<DriveItem, DriveItemCollectionResponse>()
        .client(client)
        .collectionPage(resp)
        .collectionPageFactory(DriveItemCollectionResponse::createFromDiscriminatorValue)
        .processPageItemCallback(item -> {
                                        // use DriveItem item...
                                        return true;
                                    })
        .build();
pageIter.iterate();

SDK Version

6.24.0

Latest version known to work for scenario above?

No response

Known Workarounds

Add Proguard rule: -keep class com.microsoft.graph.models.DriveItemCollectionResponse { *; }

Debug output

No response

Configuration

No response

Other information

No response

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

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

はじめの一歩

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

調査の方向性

com.microsoft.graph.core.tasks.PageIterator、特に PageIterator.java:300 の extractEntityListFromParsable から調査を開始し、ライブラリの Android ProGuard 設定を確認します。minified な DriveItem PageIterator の例を再現し、その後、パッケージに含まれるルールによって response method が保持され、minified な反復処理が成功することを検証します。

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

評価

技術スタック
android, java
領域
build-system, mobile
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
52/100

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

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