microsoftgraph / microsoftgraph/msgraph-sdk-php

Error in using sdk in Symfony with caching

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

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

主要言語
PHP
スター
669
フォーク
150
平均マージ
15時間 21分
マージ済み PR(30日)
3

説明

When I get a model from the graph, I get the correct model. But I'm using caching in Symfony to save requests.

return $this->cache->get($cacheKey, function (ItemInterface $item) use ($type, $email) {
            $item->expiresAfter(self::CACHE_EXPIRES_IN_SECONDS_SHORT);
        try {
            $requestConfig
                = new GroupsRequestBuilderGetRequestConfiguration(queryParameters: GroupsRequestBuilderGetRequestConfiguration::createQueryParameters(filter: 'startsWith(mail,\''
                . $email . '\')'));

            $groups = $this->graphClient->groups()->get($requestConfig)->wait()->getValue();
            if ($groups) {
                foreach ($groups as $group) {
                    if ($group instanceof \Microsoft\Graph\Generated\Models\Group && $group->getMail() == $email) {
                        return $group;
                    }
                }
            }

            return null;
        } catch (ApiException $exception) {
            $this->handleException($exception);
        }

        });

In my local machine, this gives no trouble, when testing this.
On my remote machine, I get an error

In DefaultMarshaller.php line 50:
Serialization of 'Closure' is not allowed 

It seems the serialization does not work well on this model?

Any suggestions?
Tim

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

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

はじめの一歩

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

調査の方向性

Issue に示されている Symfony のキャッシュコールバックから始め、DefaultMarshaller.php の 50 行目を調べてから、エラーの発生状況が異なるローカル環境とリモート環境を比較します。キャッシュを介したモデル取得を再現し、失敗しているシリアライゼーション境界を特定します。原因が文書化され、その動作がリグレッションテストでカバーされれば完了です。

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

評価

技術スタック
php, symfony
領域
api, backend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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