Closed
Bug 434818
Opened 18 years ago
Closed 18 years ago
Sync saved form data
Categories
(Cloud Services :: General, defect, P1)
Cloud Services
General
Tracking
(Not tracked)
RESOLVED
FIXED
0.2
People
(Reporter: hello, Assigned: anant)
References
Details
Attachments
(1 file)
|
8.00 KB,
patch
|
hello
:
review+
|
Details | Diff | Splinter Review |
Weave should sync saved form data.
| Reporter | ||
Updated•18 years ago
|
Priority: -- → P1
Target Milestone: -- → 0.2
| Assignee | ||
Comment 1•18 years ago
|
||
This *may* need some extra work in order to retrieve all keys/values stored in formhistory.sqlite since the nsIHistory interface doesn't expose a getAllEntries() method like nsILoginManager. It does. however, have a AutoCompleteSearch method, maybe giving wild-cards for both the key and value fields returns the whole set...
Assignee: nobody → anarayanan
| Assignee | ||
Comment 2•18 years ago
|
||
s/nsIHistory/nsIFormHistory2 (comment #1)
| Assignee | ||
Comment 4•18 years ago
|
||
The same database (formhistory.sqlite) is used to store form data as well as search-bar values, so we get both these with the same data type. Do we still want the user to have the option of syncing form data but not search bar history or vice-versa?
Attachment #322131 -
Flags: review?(thunder)
Comment 5•18 years ago
|
||
Comment on attachment 322131 [details] [diff] [review]
Add form data (and search bar history) data type
>+ while (stmnt.executeStep()) {
>+ var nam = stmnt.getUTF8String(1);
>+ var val = stmnt.getUTF8String(2);
>+ var key = Utils.sha1(nam + val);
Hmm, not really sure hashing makes sense here. It might make more sense to use the field name as the key, and the values an array of history items stored for that name? Eg, sync some data structure like:
{
"somefield" : [
"lol cats",
"kittens",
"lions"
],
"otherfield" : [
"beer"
],
...
}
This would also require supporting edit commands, but syncs would be a bit more efficient as a result?
| Assignee | ||
Comment 6•18 years ago
|
||
I'm not sure if that would really be efficient, because most forms have same field names. Especially in the case of search-history, there's only one key, but everytime a small change is made, you'd have to transmit the whole array inside an edit command, instead of just an add or remove.
Basically it's a trade-off between processing time (SHA1) and bulkiness of data (many small adds/removes instead of one huge edit) on every sync.
Also, if we move to a single-object-addressable model in the future, the current behavior would be preferred. Dan?
| Reporter | ||
Comment 7•18 years ago
|
||
First, just a nitpick - weave objects (each thing referenced by a guid) should be a non-array object. So it would really look like:
{ 'foo': { values: ["str1", "str2", ...]}}
Nevertheless, the problem that Anant described is true, this structure will get us edits for the entire array (with the whole array repeated) every time there's an addition/substraction from it.
Since there is no other metadata (unlike in the case of bookmarks & tags, for example), we can flatten out the structure some more and have each object represent a key-value pair. This way we'll mostly get adds and deletes, just for the data we're adding/deleting.
| Reporter | ||
Comment 8•18 years ago
|
||
Comment on attachment 322131 [details] [diff] [review]
Add form data (and search bar history) data type
Looks good. I'm not sure if you should throw in the edit command:
+ throw "Form syncs are expected to only be create/remove!";
Maybe only this._log.error() ? Throwing will cause sync to stop for that engine, and I'm not sure that's what we want.
| Reporter | ||
Comment 9•18 years ago
|
||
Comment on attachment 322131 [details] [diff] [review]
Add form data (and search bar history) data type
Or, maybe even warn().
r+ otherwise.
Attachment #322131 -
Flags: review?(thunder) → review+
| Assignee | ||
Comment 10•18 years ago
|
||
Checked-in revision 357.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Component: Weave → General
Product: Mozilla Labs → Weave
Updated•17 years ago
|
QA Contact: weave → general
Comment 11•16 years ago
|
||
Investigating this bug for being potential crossweave automation test case
candidate.
Flags: in-testsuite?
You need to log in
before you can comment on or make changes to this bug.
Description
•