Page 1 of 1

Caching & returning different device ID

Posted: Thu Jul 07, 2011 5:31 am
by digitalronin
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

Re: Caching & returning different device ID

Posted: Thu Jul 07, 2011 8:38 am
by kamermans
Hi David,

This is very strange indeed! I'm not sure how this is happening, but I'll certainly look into it. A preliminary check on a few of my test boxes, including Tera-WURFL Explorer shows this device being detected as dell_streak_7_ver1.

Can you verify that the script you are using to see the ID is not actually showing the fall_back id? That would explain the behavior you're seeing since dell_streak_ver1 is the first fall back for dell_streak_7_ver1.

Re: Caching & returning different device ID

Posted: Fri Jul 08, 2011 3:03 pm
by digitalronin
Hi Steve

Weird - it's not doing it anymore - I'm getting that useragent recognised as dell_streak_7_ver1 now, with an empty cache table.

The only change I made that could be relevant is to update to the latest wurfl.xml, which I did after I made my original post.

Sorry about that - false alarm. Still, at least I can remove my workaround from my regression tests.

All the best

David

Re: Caching & returning different device ID

Posted: Sat Jul 09, 2011 9:14 am
by kamermans
Ok, well I'm glad it's resolved as it sounds like a very tricky problem to track down!