Caching & returning different device ID
Posted: Thu Jul 07, 2011 5:31 am
Hi Steve & Luca
I'm working on some regression tests, using the code formerly known as TeraWURFL, and seeing a bit of odd behaviour wrt. caching.
If I empty the cache table, and try to recognise this useragent;
Mozilla/5.0 (Linux; U; Android 2.2.2; ko-KR; Dell Streak)
I get the device ID: dell_streak_ver1
This is fine, but the data that is stored in the cache table looks like this;
mysql> select * from TeraWurflCache\G
*************************** 1. row ***************************
user_agent: Mozilla/5.0 (Linux; U; Android 2.2; xx-xx; Dell Streak)
cache_data: a:34:{s:2:"id";s:18:"dell_streak_7_ver1";s: ...
As you can see, the device ID in the serialised data is dell_streak_7_ver1.
So, any subsequent checks on that useragent will return the dell_streak_7_ver1 device ID, not dell_streak_ver1
Of course, this is not a huge problem, since both IDs are basically referring to the same device. But, it is a bit odd if the code is recognising a device as one thing, but then caching the recognised data as something else.
Good luck with the new venture.
David
I'm working on some regression tests, using the code formerly known as TeraWURFL, and seeing a bit of odd behaviour wrt. caching.
If I empty the cache table, and try to recognise this useragent;
Mozilla/5.0 (Linux; U; Android 2.2.2; ko-KR; Dell Streak)
I get the device ID: dell_streak_ver1
This is fine, but the data that is stored in the cache table looks like this;
mysql> select * from TeraWurflCache\G
*************************** 1. row ***************************
user_agent: Mozilla/5.0 (Linux; U; Android 2.2; xx-xx; Dell Streak)
cache_data: a:34:{s:2:"id";s:18:"dell_streak_7_ver1";s: ...
As you can see, the device ID in the serialised data is dell_streak_7_ver1.
So, any subsequent checks on that useragent will return the dell_streak_7_ver1 device ID, not dell_streak_ver1
Of course, this is not a huge problem, since both IDs are basically referring to the same device. But, it is a bit odd if the code is recognising a device as one thing, but then caching the recognised data as something else.
Good luck with the new venture.
David