[client-app, client-sync] Save imap folder names in the client-app

Summary:
Client-sync has the full imap folder names, but used to only pass the display
name to the application. The application needs the full imap names so that it
can pass them via metadata to cloud-workers that need to open imap boxes.

Test Plan: manual

Reviewers: evan, juan

Reviewed By: evan, juan

Subscribers: juan

Differential Revision: https://phab.nylas.com/D3951
This commit is contained in:
Halla Moore 2017-02-16 15:37:27 -08:00
parent 393474a4d8
commit 57ff111925
3 changed files with 6 additions and 0 deletions

View file

@ -71,6 +71,10 @@ export default class Category extends Model {
modelKey: 'displayName', modelKey: 'displayName',
jsonKey: 'display_name', jsonKey: 'display_name',
}), }),
imapName: Attributes.String({
modelKey: 'imapName',
jsonKey: 'imap_name',
}),
syncProgress: Attributes.Object({ syncProgress: Attributes.Object({
modelKey: 'syncProgress', modelKey: 'syncProgress',
jsonKey: 'sync_progress', jsonKey: 'sync_progress',

View file

@ -101,6 +101,7 @@ export default (sequelize, Sequelize) => {
object: 'folder', object: 'folder',
name: this.role, name: this.role,
display_name: formatImapPath(this.name), display_name: formatImapPath(this.name),
imap_name: this.name,
sync_progress: this.syncProgress(), sync_progress: this.syncProgress(),
// intentionally overwrite any sync states stored in edgehill.db, // intentionally overwrite any sync states stored in edgehill.db,
// since it may contain long arrays and cause perf degredation // since it may contain long arrays and cause perf degredation

View file

@ -51,6 +51,7 @@ module.exports = (sequelize, Sequelize) => {
object: 'label', object: 'label',
name: this.role, name: this.role,
display_name: formatImapPath(this.name), display_name: formatImapPath(this.name),
imap_name: this.name,
}; };
}, },
}, },