helpscout / helpscout-api-php

PHP Wrapper for the Help Scout API
MIT License
98 stars 62 forks source link

Empty conversation object returned from client->conversations()->list() endpoint. #178

Closed scr4bble closed 5 years ago

scr4bble commented 5 years ago

I ran the code bellow and got paged collection that contained one conversation object with uninitialized attributes. Empty collection was expected since no conversation match the criteria from filters in time of running the code.

$filters = (new ConversationFilters())
    ->withMailbox(58982)
    ->withStatus('active')
    ->withQuery('assigned:"Unassigned"');
$filters = $filters->withTag('pax lost');
$conversations = $client->conversations()->list($filters);
// $conversations->count() == 1

Pastebin showing output of the code bellow - showing uninitialized conversation that was unexpectedly returned:

foreach ($conversations as $conv)
    var_dump($conv);

Could you please check what is wrong? I had to update the library (2.1.1 -> 2.3.7) because of the commit https://github.com/helpscout/helpscout-api-php/commit/a405aee0293e41e679d39f9c0d00e67272e58948 that introduced backward incompatible change in your backend and caused our code to produce an exception (same one as I already reported once here: https://github.com/helpscout/helpscout-api-php/issues/119). After upgrading the client to 2.3.7 the exception was gone, but issue described in this post has arised instead.

bkuhl commented 5 years ago

I'm sorry we haven't addressed this sooner. This is for sure an issue and I've opened a pull request which includes a fix. Once merged, we'll get a new version of the SDK out.

bkuhl commented 5 years ago

This has been fixed with https://github.com/helpscout/helpscout-api-php/releases/tag/2.3.8