Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined property: Ably\Models\Stats\MessageCount::$category #209

Open
diego-lipinski-de-castro opened this issue Jan 24, 2025 · 6 comments

Comments

@diego-lipinski-de-castro
Copy link

diego-lipinski-de-castro commented Jan 24, 2025

Steps to reproduce

$ablyRest = new AblyRest(config('broadcasting.connections.ably.key'));
$ablyRest->stats(['unit' => 'hour']);

PHP 8.3.16
"laravel/framework": "^11.22.0"
"ably/ably-php": "^1.1"

Image

┆Issue is synchronized with this Jira Task by Unito

@lawrence-forooghian
Copy link

Hi @diego-lipinski-de-castro, thanks for raising this issue. I have not yet been able to reproduce it. Would you please be able to share the full stack trace? In particular, I'd like to know who is trying to access the $category property, since as far as I can tell there are no references to this property in the ably-php codebase.

@diego-lipinski-de-castro
Copy link
Author

Sure, here it is!

https://flareapp.io/share/LPlo6v2m#context

@sacOO7
Copy link
Collaborator

sacOO7 commented Feb 3, 2025

@diego-lipinski-de-castro, before we proceed, I have a few questions.
Since we're using ably-php within our laravel project, I suggest reviewing the following libraries and their README files:

  1. Ably PHP Laravel
  2. Laravel Broadcaster for Ably

@sacOO7
Copy link
Collaborator

sacOO7 commented Feb 3, 2025

Also, as @lawrence-forooghian mentioned there doesn't seem to be any references to accessing category in the shared codebase. You can check MessageCount.php, property category doesn't exist, so you shouldn't be able to access it either : (

@sacOO7
Copy link
Collaborator

sacOO7 commented Feb 3, 2025

Since, stats method is not a laravel/user specific, you should be able to run stats method in a separate PHP file by installing/importing ably-php .

@sacOO7
Copy link
Collaborator

sacOO7 commented Feb 3, 2025

Also, I am not sure why $ablyRest->stats(['unit' => 'hour']); doesn't store response in any variable?
Then is the response being implicitly accessed?
We are already accessing stats in a method right below it at Line 36 using

$stats = $ablyRest->get('/stats?unit=hour');

So, maybe we don't need $ablyRest->stats(['unit' => 'hour']); in the first place wdyt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants