Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor folder sync #326

Merged
merged 54 commits into from
Aug 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
5bd5eee
Move imap related classes to OCA\Mail\IMAP namespace
ChristophWurst Feb 28, 2017
d52e2f2
Add request-response based synchronizer around horde sync
ChristophWurst Feb 28, 2017
95a7090
Implementd and test imap message mapper
ChristophWurst Mar 1, 2017
55ff914
Send client sync request to refresh messages; cursor-based pagination
ChristophWurst Mar 2, 2017
7a576bc
Implement date- and cursor-based pagination
ChristophWurst Mar 2, 2017
7b39eb7
Implement client-side horde sync mechanism
ChristophWurst Mar 2, 2017
4b7c9f8
Sync single and unified mailboxes efficiently
ChristophWurst Mar 26, 2017
a51f0cb
Remove debug statement
ChristophWurst Mar 26, 2017
c790efa
Minor code cleanup
ChristophWurst Mar 26, 2017
70c2170
Remove debug messages
ChristophWurst Mar 26, 2017
332ac83
Synchronize and paginate the unified inbox
ChristophWurst Mar 27, 2017
1a11059
Fix php docblock
ChristophWurst Apr 18, 2017
8a1b3df
Always log message loading errors and resolve promise correctly
ChristophWurst May 8, 2017
49e11dc
Make messages loadable again
ChristophWurst May 8, 2017
bdcc9f1
Don't rely on global state variables when chaning clags/deleting mess…
ChristophWurst May 15, 2017
77f161c
Use message object directly instead of buggy lookup
ChristophWurst May 15, 2017
46be5f3
Only limit search to cursor time if it's actually set
ChristophWurst May 15, 2017
a1ff649
Remove dead pagination code
ChristophWurst May 15, 2017
d8300e0
Use proper DateTime object as cursor
ChristophWurst May 15, 2017
9145dc9
Add a sync token to the special favs folder
ChristophWurst May 15, 2017
3dc5c18
Merge branch 'nc13' of github.com:/nextcloud/mail into refactor/folde…
ChristophWurst May 22, 2017
96251af
Merge branch 'master' of github.com:/nextcloud/mail into refactor/fol…
ChristophWurst May 22, 2017
01f8df0
Add simple and flagged mailbox sync strategy
ChristophWurst May 22, 2017
172ac48
Fix tests and remove buggy folder change detection
ChristophWurst May 23, 2017
4b96f64
Fix searching messages
ChristophWurst May 29, 2017
dc5dad9
Sync unified inbox to changes in indidual ones
ChristophWurst May 29, 2017
ccde731
Fix HTML body loading and only load sync token for non-noselect folders
ChristophWurst May 29, 2017
7df04f0
Fix UIDs missing from sync request and don't fail hard if unified inb…
ChristophWurst May 29, 2017
870926a
Merge branch 'master' of github.com:/nextcloud/mail into refactor/fol…
ChristophWurst Jun 12, 2017
8659ab5
Remove unused local vars
ChristophWurst Jun 12, 2017
bc1cdb1
Fix deleting messages after the folder was synced once
ChristophWurst Jun 12, 2017
4b6136f
Merge branch 'master' of github.com:/nextcloud/mail into refactor/fol…
ChristophWurst Jun 19, 2017
ee2e2b0
Fix search results being showed as folder content
ChristophWurst Jun 19, 2017
4c5b66f
Do not overwrite 'flags' property of messages but merge values
ChristophWurst Jun 19, 2017
96bdcd7
Fix flagging of messages as read when the are opened
ChristophWurst Jun 19, 2017
3fcb024
Fix unified folder color indicator
ChristophWurst Jun 20, 2017
0fa9ee7
Defer loading folder messages a bit
ChristophWurst Jun 20, 2017
2337f74
Merge branch 'master' of github.com:/nextcloud/mail into refactor/fol…
ChristophWurst Jun 26, 2017
1420179
Merge branch 'master' of github.com:/nextcloud/mail into refactor/fol…
ChristophWurst Jul 3, 2017
3d01e69
Sync message deletion of unified/specific inbox
ChristophWurst Jul 3, 2017
db61b75
Fix selection of next message
ChristophWurst Jul 3, 2017
c52a330
Correctly handle success/error when creating a new account
ChristophWurst Jul 31, 2017
50d330a
Merge branch 'master' of github.com:/nextcloud/mail into refactor/fol…
ChristophWurst Aug 7, 2017
154f88b
Add a simple integration test for the folder sync feature
ChristophWurst Aug 7, 2017
cebc002
Fix js unit tests
ChristophWurst Aug 7, 2017
fc0843c
Fix mocked type to ensure the parameter has the correct type
ChristophWurst Aug 7, 2017
699880b
Fix message replies
ChristophWurst Aug 7, 2017
86541ab
Merge branch 'master' of github.com:/nextcloud/mail into refactor/fol…
ChristophWurst Aug 7, 2017
07a90df
Fix imported class
ChristophWurst Aug 7, 2017
4666961
Also test changed and vanished message sync
ChristophWurst Aug 7, 2017
f96416b
Merge branch 'master' of github.com:/nextcloud/mail into refactor/fol…
ChristophWurst Aug 11, 2017
4552e8b
Merge branch 'master' of github.com:/nextcloud/mail into refactor/fol…
ChristophWurst Aug 21, 2017
663d571
Fix mail manager test
ChristophWurst Aug 21, 2017
18a0478
Merge branch 'master' of github.com:/nextcloud/mail into refactor/fol…
ChristophWurst Aug 21, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 69 additions & 46 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,54 +20,77 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/

$app = new \OCA\Mail\AppInfo\Application();
$app->registerRoutes($this,
[
'routes' => [
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
['name' => 'page#compose', 'url' => '/compose', 'verb' => 'GET'],
['name' => 'accounts#send', 'url' => '/accounts/{accountId}/send', 'verb' => 'POST'],
['name' => 'accounts#draft', 'url' => '/accounts/{accountId}/draft', 'verb' => 'POST'],
[
'name' => 'messages#downloadAttachment',
'url' => '/accounts/{accountId}/folders/{folderId}/messages/{messageId}/attachment/{attachmentId}',
'verb' => 'GET'],
[
'name' => 'messages#saveAttachment',
'url' => '/accounts/{accountId}/folders/{folderId}/messages/{messageId}/attachment/{attachmentId}',
'verb' => 'POST'],
[
'name' => 'messages#getHtmlBody',
'url' => '/accounts/{accountId}/folders/{folderId}/messages/{messageId}/html',
'verb' => 'GET'],
[
'name' => 'messages#setFlags',
'url' => '/accounts/{accountId}/folders/{folderId}/messages/{messageId}/flags',
'verb' => 'PUT'],
[
'name' => 'messages#move',
'url' => '/accounts/{accountId}/folders/{folderId}/messages/{id}/move',
'verb' => 'POST'],
[
'name' => 'proxy#redirect',
'url' => '/redirect',
'verb' => 'GET'],
[
'name' => 'proxy#proxy',
'url' => '/proxy',
'verb' => 'GET'],
[
'name' => 'folders#detectChanges',
'url' => '/accounts/{accountId}/folders/detectChanges',
'verb' => 'POST'],
'routes' => [
[
'name' => 'page#index',
'url' => '/',
'verb' => 'GET'
],
[
'name' => 'page#compose',
'url' => '/compose',
'verb' => 'GET'
],
[
'name' => 'accounts#send',
'url' => '/accounts/{accountId}/send',
'verb' => 'POST'
],
[
'name' => 'accounts#draft',
'url' => '/accounts/{accountId}/draft',
'verb' => 'POST'
],
[
'name' => 'folders#sync',
'url' => '/accounts/{accountId}/folders/{folderId}/sync',
'verb' => 'GET'
],
[
'name' => 'messages#downloadAttachment',
'url' => '/accounts/{accountId}/folders/{folderId}/messages/{messageId}/attachment/{attachmentId}',
'verb' => 'GET'
],
[
'name' => 'messages#saveAttachment',
'url' => '/accounts/{accountId}/folders/{folderId}/messages/{messageId}/attachment/{attachmentId}',
'verb' => 'POST'
],
[
'name' => 'messages#getHtmlBody',
'url' => '/accounts/{accountId}/folders/{folderId}/messages/{messageId}/html',
'verb' => 'GET'
],
[
'name' => 'messages#setFlags',
'url' => '/accounts/{accountId}/folders/{folderId}/messages/{messageId}/flags',
'verb' => 'PUT'
],
[
'name' => 'messages#move',
'url' => '/accounts/{accountId}/folders/{folderId}/messages/{id}/move',
'verb' => 'POST'
],
[
'name' => 'proxy#redirect',
'url' => '/redirect',
'verb' => 'GET'
],
[
'name' => 'proxy#proxy',
'url' => '/proxy',
'verb' => 'GET'
],
'resources' => [
'autoComplete' => ['url' => '/autoComplete'],
],
'resources' => [
'autoComplete' => ['url' => '/autoComplete'],
'localAttachments' => ['url' => '/attachments'],
'accounts' => ['url' => '/accounts'],
'folders' => ['url' => '/accounts/{accountId}/folders'],
'messages' => ['url' => '/accounts/{accountId}/folders/{folderId}/messages'],
'aliases' => ['url' => '/accounts/{accountId}/aliases'],
]
]);
'accounts' => ['url' => '/accounts'],
'folders' => ['url' => '/accounts/{accountId}/folders'],
'messages' => ['url' => '/accounts/{accountId}/folders/{folderId}/messages'],
'aliases' => ['url' => '/accounts/{accountId}/aliases'],
]
]);
1 change: 1 addition & 0 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ define(function(require) {
require('service/attachmentservice');
require('service/davservice');
require('service/folderservice');
require('service/foldersyncservice');
require('service/messageservice');
require('service/aliasesservice');
require('util/notificationhandler');
Expand Down
77 changes: 0 additions & 77 deletions js/background.js

This file was deleted.

16 changes: 3 additions & 13 deletions js/controller/accountcontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ define(function(require) {

var FolderController = require('controller/foldercontroller');
var Radio = require('radio');
var UPDATE_INTERVAL = 5 * 60 * 1000; // 5 minutes

function startBackgroundChecks(accounts) {
setInterval(function() {
require('background').checkForNotifications(accounts);
}, UPDATE_INTERVAL);
}

/**
* Load all accounts
Expand All @@ -44,18 +37,15 @@ define(function(require) {
})).then(function() {
return accounts;
});
}).then(function(accounts) {
startBackgroundChecks(accounts);
return accounts;
}, function(e) {
console.error(e);
Radio.ui.trigger('error:show', t('mail', 'Error while loading the accounts.'));
}).then(function(accounts) {
// Show accounts regardless of the result of
// loading the folders
Radio.ui.trigger('sidebar:accounts');

return accounts;
}, function(e) {
console.error(e);
Radio.ui.trigger('error:show', t('mail', 'Error while loading the accounts.'));
});
}

Expand Down
Loading