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

[4.x] Fix Browser Sessions not showing platform and browser #1412

Merged
merged 4 commits into from Nov 29, 2023

Conversation

olumby
Copy link
Contributor

@olumby olumby commented Nov 29, 2023

Browser Sessions are currently showing '1-1' when they should be displaying 'Platform - Browser', the image below shows reality/expected behaviour.

browser sessions

#1399 used the cache implemented in mobiledetect/mobiledetectlib which only supports bool values. As multiple calls to agent->platform() and agent->browser() are made in the component the cache is engaged and produces boolean values instead of the expected strings.

This pull request replaces the mobiledetect cache implementation with a simple key value store on the Agent class.

Current tests pass as the first call to agent->platform() and agent->browser() do not hit the cache. Hopefully I will have time tomorrow to update the tests too.

I am not sure if this is the ideal solution or if the mobiledetect cache should be reimplemented to support mixed values. I briefly considered using the Laravel cache, but considering this data is only stored for the request lifecycle it seemed a little over the top.

@crynobone

This comment was marked as outdated.

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
@olumby
Copy link
Contributor Author

olumby commented Nov 29, 2023

nice, thanks for sorting out the tests 😄

@taylorotwell taylorotwell merged commit 252348e into laravel:4.x Nov 29, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants