Skip to content
This repository has been archived by the owner. It is now read-only.

[IP-474] Fix Query suggestions disappearing randomly #344

Merged
7 commits merged into from Jun 18, 2019
Merged

[IP-474] Fix Query suggestions disappearing randomly #344

7 commits merged into from Jun 18, 2019

Conversation

@ghost
Copy link

@ghost ghost commented Jun 12, 2019

Some result suggestion providers (mainly google) return ASCII formatted JSON instead of UTF-8 formatted JSON. To counter this, we first try to decode the result provider data using UTF-8, but retry with ASCII if that fails.

It has been discussed to check the header data, but since that is misleading in some cases (e.g. Google gives gzip as the encoding), this way is more robust.

Firefox solves this a different way by completely replacing AlamoFire in the project. I advocate that we should update our codebase with the FF codebase at some point, but for now this fixes the issue.

Pull Request Checklist

  • My patch has gone through review and I have addressed review comments
  • My patch has a standard commit message that looks like Bug 12345678 - This fixes something something
  • I have updated the Unit Tests to cover new or changed functionality
  • I have updated the UI Tests to cover new or changed functionality
  • I have marked the bug with [needsuplift]
  • I have made sure that localizable strings use NSLocalizableString()

Screenshots

n/a

Notes for testing this patch

Try to force the search engine to reply with umlauts or other special characters. A string that tripped up the query suggestion before was un, because the result contained unwetter münchen. Also good is fc bayern m because the results will include fc augsburg is viel besser als münchen or something.

winsmith and others added 4 commits Jun 12, 2019
Daniel Jilg
Daniel Jilg
Copy link
Contributor

@naira-cliqz naira-cliqz left a comment

Is this a fix from FF? Or you did your own way?

@ghost
Copy link
Author

@ghost ghost commented Jun 18, 2019

The firefox fix involves ripping out AlamoFire out of the entire project and replacing it with a URLRequest based solution. I tried porting that, but it has too many far reaching dependencies, so instead I wrote this home grown solution to the bug for now, hoping that in the future we will fix this by upgrading to the most recent version of FF.

winsmith and others added 2 commits Jun 18, 2019
Daniel Jilg
Daniel Jilg
@ghost ghost merged commit 9d5940f into ghostery:master Jun 18, 2019
3 checks passed
3 checks passed
@azure-pipelines
ghostery.browser-ios Build #20190618.5 succeeded
Details
@azure-pipelines
ghostery.browser-ios (Cliqz_IOS_CI_Build Ghostery) Cliqz_IOS_CI_Build Ghostery succeeded
Details
@azure-pipelines
ghostery.browser-ios (Cliqz_IOS_CI_Build Lumen) Cliqz_IOS_CI_Build Lumen succeeded
Details
@ghost ghost deleted the IP-474-flashing-suggestions branch Jun 18, 2019
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants