Merge lp://staging/~neric27/midori/mz-sync into lp://staging/midori

Proposed by Eric Le Lay
Status: Work in progress
Proposed branch: lp://staging/~neric27/midori/mz-sync
Merge into: lp://staging/midori
Diff against target: 15594 lines (+15092/-44)
39 files modified
CMakeLists.txt (+6/-0)
extensions/CMakeLists.txt (+18/-0)
extensions/mz-sync/ClientConfig.h (+4/-0)
extensions/mz-sync/README (+279/-0)
extensions/mz-sync/decode.c (+262/-0)
extensions/mz-sync/decode.h (+44/-0)
extensions/mz-sync/glib2.supp (+486/-0)
extensions/mz-sync/js.c (+494/-0)
extensions/mz-sync/js.h (+76/-0)
extensions/mz-sync/main.c (+1221/-0)
extensions/mz-sync/mz-sync-change-tracker.c (+1647/-0)
extensions/mz-sync/mz-sync-change-tracker.h (+113/-0)
extensions/mz-sync/mz-sync-extension.c (+2136/-0)
extensions/mz-sync/mz-sync-extension.h (+205/-0)
extensions/mz-sync/mz-sync-katze-utils.c (+240/-0)
extensions/mz-sync/mz-sync-katze-utils.h (+88/-0)
extensions/mz-sync/mz-sync-panel.c (+1217/-0)
extensions/mz-sync/mz-sync-panel.h (+67/-0)
extensions/mz-sync/mz-sync-persist.c (+317/-0)
extensions/mz-sync/mz-sync-persist.h (+48/-0)
extensions/mz-sync/mz-sync-tabby-session.c (+637/-0)
extensions/mz-sync/mz-sync-tabby-session.h (+96/-0)
extensions/mz-sync/mz-sync-tabby-storage.c (+412/-0)
extensions/mz-sync/mz-sync-tabby-storage.h (+62/-0)
extensions/mz-sync/mz-sync-tabby.h (+52/-0)
extensions/mz-sync/mz-sync.c (+810/-0)
extensions/mz-sync/sample_content_cleartext.json (+100/-0)
extensions/mz-sync/sample_content_cleartext_plus_midori.json (+115/-0)
extensions/mz-sync/sample_content_cleartext_with_tabs.json (+162/-0)
extensions/mz-sync/sync.c (+3330/-0)
extensions/mz-sync/sync.h (+165/-0)
extensions/tabby.vala (+15/-1)
katze/katze-array.c (+53/-2)
katze/katze-arrayaction.c (+10/-0)
midori/midori-array.c (+4/-3)
midori/midori-bookmarks-db.c (+85/-13)
midori/midori-bookmarks-db.h (+3/-4)
midori/midori-browser.c (+12/-20)
panels/midori-bookmarks.c (+1/-1)
To merge this branch: bzr merge lp://staging/~neric27/midori/mz-sync
Reviewer Review Type Date Requested Status
Midori Devs Pending
Review via email: mp+198164@code.staging.launchpad.net

Description of the change

propose merging of mozilla sync code

To post a comment you must log in.
lp://staging/~neric27/midori/mz-sync updated
6513. By Eric Le Lay

add "add bookmark" button in panel to play with sync

current page is added to the synced bookmarks but will be squashed
upon the next sync since changes are not yet pulled to the server.

removed some g_object_unref because they triggered assertion error.
Not sure about that

6514. By Eric Le Lay

compile standalone sync client

6515. By Eric Le Lay

use unencrypted content on disk to facilitate inspection during development

6516. By Eric Le Lay

Howto about testing mz-sync

6517. By Eric Le Lay

merge from midori trunk

6518. By Eric Le Lay

add and delete bookmarks on server, generate_id fixed

- generate_id now really returns a string of length 12 (was too short)
- WBOs can be individually deleted instead of the whole collection previously
- if one adds a bookmark, the parent must then be modified to include it

6519. By Eric Le Lay

factor code of delete_collection_int and delete_wbos_by_id_int; formatting

6520. By Eric Le Lay

upload bookmark changes on server

- now a button to add current tab to synced bookmarks
- now context menu to delete selected bookmark/folder from synced bookmarks
- depending on sync options, bookmarks are added/deleted on server
- bookmarks are not yet monitored for changes

6521. By Eric Le Lay

fix crashes when add,sync,delete,sync

- count newly added when updating bookmarks to still break even
- add bookmark to trash before removing from parent array so it's not freed

6522. By Eric Le Lay

add comment

6523. By Eric Le Lay

shortest status message

6524. By Eric Le Lay

delay first sync until first window created

also show first sync status in panel

6525. By Eric Le Lay

ease valgrind debugging

6526. By Eric Le Lay

add/remove folder

this is just a stub so calling folder "dummy" for now

6527. By Eric Le Lay

fix memory leaks in MzSync

6528. By Eric Le Lay

list synced tabs

6529. By Eric Le Lay

prepare for tabs upload

6530. By Eric Le Lay

firefox sync insists in having a parentid in bookmarks and folders

6531. By Eric Le Lay

don't printf unknown string.

Caused the inevitable segfault when string to print contained percents.
The actual one was 'fprintf(file, jsn)' but I changed all to fputs/fputc.

6532. By Eric Le Lay

don't hard delete bookmarks and folders but mark them deleted

This is the only way Firefox won't reinstantiate them upon next sync.
They consume space so must be purged at some time: when
we hit a quota limit maybe. Firefox never seems to delete them except
when user chooses to delete all data.

6533. By Eric Le Lay

merge Trunk

6534. By Eric Le Lay

add the sessionId field to synced tab to handle multiple sessions

This is not supported but hopefully ignored by Firefox Sync.

6535. By Eric Le Lay

show sessionId in MzSync --list-tabs

6536. By Eric Le Lay

an error dialog that actually works

6537. By Eric Le Lay

implement Tabby's Storage (not complete) using mz-sync as backend

Tabby does nothing concrete with the mz-sync backend (see method
register_storage in tabby.vala)

6538. By Eric Le Lay

merge trunk r6595

6539. By Eric Le Lay

fix uninitialized variable

6540. By Eric Le Lay

fix segfault when deleting root folders in bookmarks

Prevent user from deleting them.
There is still the case when switching to an empty sync account,
where they are deleted programatically. Then
mz_sync_panel_remove_iter uses a different way to iterate.

6541. By Eric Le Lay

new function create_bookmarks to create default bookmark items

Also fix an bug where children property was not created in wbo for folder
with null children array. Now the children property is created as empty
array.

Minor change in syncItem_to_wbo where it uses the correct collection name
for bookmarks/tabs to encrypt. This makes no change since there is only
one collection key, but it could, if different keys were used per session.

6542. By Eric Le Lay

mz-sync: create default bookmarks when registering.

Doesn't take the sync options into account because registering to use
mz-sync in shadow mode doesn't make sense. Register with the other program
if you want that.

6543. By Eric Le Lay

use registered storage for real.

If the other extension takes too long to activate
(blocks on an error dialog in my case), the local storage will still be used.
This is not intended.

Anyway some combination of local/remote storage should be used.

6544. By Eric Le Lay

implement MzSyncTabbyStorage, MzSyncTabbySession, plug into tabby

It passes the Firefox test: open tabs seen by running ff with same account
(must refresh each time in about:sync-tabs to see new content,
 but no need to click "sync now").

Fix a bug when deleting items with ids containing + or / (they are base 64).

6545. By Eric Le Lay

merge trunk r6613

6546. By Eric Le Lay

MzSync: export bookmarks as HTML by default

6547. By Eric Le Lay

updated README

6548. By Eric Le Lay

free session, save icon

MzSyncTabbySession should free its memory now.

the icon is always null for tabs.

6549. By Eric Le Lay

fix string not duplicated resulting in crash at startup

6550. By Eric Le Lay

fix wrong variable used, resulting in always restoring tabs from last client

6551. By Eric Le Lay

fix a double g_strdup resulting in memory leak

6552. By Eric Le Lay

Show tabs from other devices in panel.

Saving own tabs is done via the MzSyncTabbySession for now.
Another solution based on polling could be used to save tabs if not
hooking into MzSyncTabbySession, for users wanting to keep tabby session local,
but to "publish" open tabs for other devices.
This solution would extend the code used to refresh displayed tabs, to upload own
tabs after downloading, like for bookmarks.

6553. By Eric Le Lay

only fetch modified tabs; load tabs at startup

6554. By Eric Le Lay

only fetch changed bookmarks since last sync from server

6555. By Eric Le Lay

restore gtk2 compatibility

6556. By Eric Le Lay

fix errors pointed by extra warnings

6557. By Eric Le Lay

merge trunk rev 6669

6558. By Eric Le Lay

adapt to tabby_base_session_get_tab_sorting return double, not double*

6559. By Eric Le Lay

turbo mode: sync every 5 seconds

This is handy when running sync on two devices side by side and wanting
changes to be propagated almost instantly. Since the Sync API is based
on polling this adds traffic and server load (not too much since
If-Modified-Since and newer are used).

6560. By Eric Le Lay

update doc

6561. By Eric Le Lay

First try to sync real midori bookmarks

- abstract KatzeItem syncid storing and retrieving in mz_sync_katze_utils
  (and it's now a meta_integer instead of the token)
- implement storing missing boolean preferences
- register for changes of MidoriBookmarksDb
- retrieving real midori bookmarks is broken for the moment
- load/save db id<->syncid in string prefs, see mz_sync_persist

6562. By Eric Le Lay

merge trunk r6687

6563. By Eric Le Lay

merge lp:~aauzi/midori/fix-bookmarks-menu-update-regression r6577

6564. By Eric Le Lay

adapt to rename tabby_storage_get_sessions -> get_saved_sessions

6565. By Eric Le Lay

fix name<->id mixup

6566. By Eric Le Lay

trying to deal with the real bookmarks, INCOMPLETE

Merge basically untested.

6567. By Eric Le Lay

modify the real bookmarks, mostly working now.

missing memory free

6568. By Eric Le Lay

merge trunk r6701

Revision history for this message
gue5t gue5t (gue5t) wrote :

This is pretty impressive, and I'm glad you've paid attention to memory management concerns. :)

I noticed one tiny obvious bug: base32_size calls ceil() on an integer argument after doing an integer division. You're better off adding four and then dividing by five, all in integer math.

Revision history for this message
Eric Le Lay (neric27) wrote :

> I noticed one tiny obvious bug: base32_size calls ceil() on an integer
> argument after doing an integer division. You're better off adding four and
> then dividing by five, all in integer math.

Yes, you're right!
With len=1 it was producing 0...
Luckily it was only called with 20.
I'll fix my code as you suggest.
Thank you very much!!

Revision history for this message
Eric Le Lay (neric27) wrote :

> I noticed one tiny obvious bug: base32_size calls ceil() on an integer
> argument after doing an integer division. You're better off adding four and
> then dividing by five, all in integer math.

Yes, you're right!
With len=1 it was producing 0...
Luckily it was only called with 20.
I'll fix my code as you suggest.
Thank you very much!!

lp://staging/~neric27/midori/mz-sync updated
6569. By Eric Le Lay

fix bug in base32_size (spotted by gue5t)

Unmerged revisions

6569. By Eric Le Lay

fix bug in base32_size (spotted by gue5t)

6568. By Eric Le Lay

merge trunk r6701

6567. By Eric Le Lay

modify the real bookmarks, mostly working now.

missing memory free

6566. By Eric Le Lay

trying to deal with the real bookmarks, INCOMPLETE

Merge basically untested.

6565. By Eric Le Lay

fix name<->id mixup

6564. By Eric Le Lay

adapt to rename tabby_storage_get_sessions -> get_saved_sessions

6563. By Eric Le Lay

merge lp:~aauzi/midori/fix-bookmarks-menu-update-regression r6577

6562. By Eric Le Lay

merge trunk r6687

6561. By Eric Le Lay

First try to sync real midori bookmarks

- abstract KatzeItem syncid storing and retrieving in mz_sync_katze_utils
  (and it's now a meta_integer instead of the token)
- implement storing missing boolean preferences
- register for changes of MidoriBookmarksDb
- retrieving real midori bookmarks is broken for the moment
- load/save db id<->syncid in string prefs, see mz_sync_persist

6560. By Eric Le Lay

update doc

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: