Closed
Bug 964677
Opened 12 years ago
Closed 12 years ago
Json snippets should not have 'target_geo' key when country is not defined
Categories
(Snippets :: Service, defect)
Snippets
Service
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: giorgos, Assigned: giorgos)
References
Details
(Whiteboard: [kb=1254330] )
If a json snippet doesn't have country defined, do not include 'target_geo' key in it's json representation.
What's happening now:
[{"url": "http://nightly.mozilla.org/", "text": "Thanks for using Nightly!", "target_geo": "", "id": 1, "icon": "data:image/png;base64,iVBORw0KGgoAAAANSUh... }]
What's expected:
[{"url": "http://nightly.mozilla.org/", "text": "Thanks for using Nightly!", "id": 1, "icon": "data:image/png;base64,iVBORw0KGgoAAAANSUh... }]
| Assignee | ||
Updated•12 years ago
|
Assignee: nobody → giorgos
Status: NEW → ASSIGNED
| Assignee | ||
Updated•12 years ago
|
OS: Linux → All
Hardware: x86_64 → All
| Assignee | ||
Updated•12 years ago
|
Whiteboard: [kb=1254330]
Comment 1•12 years ago
|
||
Is there a particular reason why this is bad?
Comment 2•12 years ago
|
||
Commits pushed to master at https://github.com/mozilla/snippets-service
https://github.com/mozilla/snippets-service/commit/3fd058871b3d962c7913f495d959e4057e1eb8f5
[fix bug 964677] Do not include 'target_geo' in json response if no country.
https://github.com/mozilla/snippets-service/commit/07e214ae7cd08bb8313853aea2aab4c0e92cde14
Merge pull request #50 from glogiotatidis/master
[fix bug 964677] Do not include 'target_geo' in json response if no country.
Updated•12 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 3•12 years ago
|
||
For the record:
While testing snippets for android, I realized that a snippet will not show up unless we have a matching country. Digging into fennec's code I found out that if the target_geo key is present it tries to match it to the user's country. Removing it for snippets that do not have country defined will make this work properly.
https://mxr.mozilla.org/mozilla-central/source/mobile/android/components/Snippets.js#173
I decided to make the change in snippet's service, instead of filling a bug against fennec, because we follow the same pattern for desktop snippets too i.e. when country is not defined we do not include it in the data- attributes
https://github.com/mozilla/snippets-service/blob/master/snippets/base/models.py#L225
| Assignee | ||
Comment 4•12 years ago
|
||
This is now fixed and on production.
You need to log in
before you can comment on or make changes to this bug.
Description
•