Open Bug 1431823 Opened 7 years ago Updated 2 years ago

[developer] Frecency query interface is inconsistent (can return query result, or return raw SQL)

Categories

(Firefox for iOS :: Data Storage, enhancement)

Other
iOS
enhancement

Tracking

()

Tracking Status
fxios + ---

People

(Reporter: garvan, Unassigned)

References

Details

Follow up from bug 1169322 review

Richard Newman's comments:
"Follow up with some encapsulation and scoping. It shouldn't be possible to get SQL strings out of a protocol instance (BrowserHistory). It shouldn't be possible to get refreshTopSitesQuery — which relies on the frecency cache and implicitly creates it — from SQLiteHistory; that should live on SQLiteFrecentHistory, and the process of updating top sites should live there."

My comment on this:

The frecency query code is used in two ways, for url completion and for top sites list. The interface for this is odd, the first case performs the query and returns an iterable result, the second one returns the necessary SQL for the caller to then execute on the DB.

There isn't a compelling reason for SQL to bubble up, functions should execute on the DB and return a result. Might be worth skimming the DB layer for other instances of this interface discrepancy.
Depends on: 1169322
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.