Closed
Bug 1154554
Opened 10 years ago
Closed 10 years ago
Upload tabs record
Categories
(Firefox for iOS :: Sync, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
fxios | + | --- |
People
(Reporter: rnewman, Assigned: fluffyemily, Mentored)
References
Details
Attachments
(2 files, 2 obsolete files)
Fleshing out Bug 1141847. As part of tab sync we wish to upload our own tabs.
Reporter | ||
Updated•10 years ago
|
Mentor: rnewman
tracking-fxios:
--- → ?
Reporter | ||
Updated•10 years ago
|
Reporter | ||
Updated•10 years ago
|
Assignee: nobody → etoop
Status: NEW → ASSIGNED
Comment 1•10 years ago
|
||
FYI: TabManager takes a storage object to store these in a db (which I assume is needed here), but it isn't actually assigned right now. I've been meaning to fix that :)
Assignee | ||
Comment 2•10 years ago
|
||
This all _seems_ to be working - I get a success response from the PUT, but I cannot then see the tabs I should have uploaded in about:sync-tabs when I sync my desktop.
Attachment #8636034 -
Flags: feedback?(rnewman)
Assignee | ||
Comment 3•10 years ago
|
||
Comment on attachment 8636034 [details]
WIP Feedback Request
https://github.com/mozilla/firefox-ios/pull/773
Reporter | ||
Updated•10 years ago
|
Attachment #8636034 -
Flags: feedback?(rnewman) → feedback+
Assignee | ||
Comment 4•10 years ago
|
||
This one definitely works.
Attachment #8636565 -
Flags: review?(rnewman)
Reporter | ||
Comment 5•10 years ago
|
||
Comment on attachment 8636565 [details] [review]
Pull request
Close!
Attachment #8636565 -
Flags: review?(rnewman) → feedback+
Assignee | ||
Comment 6•10 years ago
|
||
Attachment #8636034 -
Attachment is obsolete: true
Attachment #8636565 -
Attachment is obsolete: true
Attachment #8637210 -
Flags: review?(rnewman)
Reporter | ||
Comment 7•10 years ago
|
||
Comment on attachment 8637210 [details] [review]
Pull request
Comments on the PR. Nice work!
Attachment #8637210 -
Flags: review?(rnewman) → review+
Reporter | ||
Comment 8•10 years ago
|
||
This produces dodgy output:
{
"title" : "reddit: the front page of the internet",
"icon" : null,
"urlHistory" : [
"http:\/\/www.reddit.com\/",
"http:\/\/localhost:56412\/about\/home\/#panel=2",
"http:\/\/www.reddit.com\/"
],
"lastUsed" : "1437702183165"
},
Reporter | ||
Comment 9•10 years ago
|
||
And it's in the DB:
["http:\/\/www.reddit.com\/","http:\/\/localhost:56412\/about\/home\/#panel=2","http:\/\/www.reddit.com\/"]
Reporter | ||
Comment 10•10 years ago
|
||
Here's the error:
history: [displayURL] + browser.historyList,
var historyList: [NSURL] {
func listToUrl(item: WKBackForwardListItem) -> NSURL { return item.URL }
var tabs = self.backList?.map(listToUrl) ?? [NSURL]()
tabs.append(self.url!)
return tabs
}
so browser.historyList *already* includes every URL, including the current one. We then tag the URL on the front. That's wrong.
Reporter | ||
Comment 11•10 years ago
|
||
This breaks the remote tabs panel.
2015-07-23 19:54:51.021 [Error] [SQLiteRemoteClientsAndTabs.swift:218] getClientsAndTabs(): Couldn't cast tab Optional(<RemoteTab clientGUID: nil, URL: https://support.mozilla.org/en-US/questions, title: Support Forum | Mozilla Support, lastUsed: 1437706465816>) to RemoteTab.
var acc = [String: [RemoteTab]]()
for tab in tabCursor {
if let tab = tab, guid = tab.clientGUID { <<<<
if acc[guid] == nil {
acc[guid] = [tab]
} else {
acc[guid]!.append(tab)
}
} else {
log.error("Couldn't cast tab \(tab) to RemoteTab.")
}
}
Of course, it has no GUID, 'cos it's local. We don't filter them out when querying.
Reporter | ||
Comment 12•10 years ago
|
||
And another issue: on first sync we'll wipe the tabs DB as we apply incoming records. That'll throw away whatever we're about to upload. We should check for `clientGUID IS NULL` when wiping here.
public func wipeTabs() -> Deferred<Result<()>> {
return self.doWipe { (conn, inout err: NSError?) -> () in
self.tabs.delete(conn, item: nil, err: &err)
}
}
…
// If this is a fresh start, do a wipe.
if self.lastFetched == 0 {
log.info("Last fetch was 0. Wiping tabs.")
return localTabs.wipeTabs()
>>== afterWipe
}
return afterWipe()
Reporter | ||
Comment 13•10 years ago
|
||
Attachment #8638291 -
Flags: review?(etoop)
Assignee | ||
Updated•10 years ago
|
Attachment #8638291 -
Flags: review?(etoop) → review+
Assignee | ||
Updated•10 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•