Nylas-mail: Manual Account Sync

Created on 23 Oct 2015  Â·  30Comments  Â·  Source: nylas/nylas-mail

It would be nice as a sanity / idiot button if we could manually sync the email data displayed in the app.

The use case is when I'm away from my desk and I read / archive data on my phone, when I come back to my desk I still have those messages in my mailbox. Knowing that the data isn't correct, I'd like the option to perform a sync action to catch the app up to the source of truth (gmail in this case). User's won't want to use the app if they believe the data presented to be wrong or out of date.

Most helpful comment

@jackiehluo I think the main issue is a lack of meaningful UI feedback. The solution suggested above, of a "last synced (X minutes / seconds) ago" would be much better than nothing at all. I can say this was one of the reasons I ended up switching away eventually from N1.

All 30 comments

I imagine this would work like the app does now when there is a sync failure.

Explicitly knowing that you can ad-hoc sync is a bit of a comfort feature, but makes total sense. I found myself looking in the activity log to see if there is any pending or failed activity. A "last-synced" label somewhere on the chrome may be a middle-ground to a full manual sync feature.

A "last-synced" label somewhere on the chrome may be a middle-ground to a full manual sync feature.

:+1:

+1 This would be great

+1 I like buttons

+1 Would be nice to have if expecting an email.

+1 Heck, I'd even fork & do it myself, if I could manage to find a place where the sync logic can be started from.

Even just an Fxx key would be nice for this. Doesn't have to be a UI button.

+1 Another use case: when I have just signed up on some site and I'm waiting for email for confirmation. But I cannot synchronize email manually...

Nylas has a persistent, streaming long connection with the Nylas servers which is connected to your email provider for the duration of this API call. There is no need for this feature in my opinion.

Your email provider sends a signal to Nylas servers as soon as it receives email, then Nylas fetches the changes (new emails, updated emails, deleted emails), saves them to its internal DB, then sends those changes to N1.

If you're on an IMAP connection, this is done through the IDLE command.

This is the API endpoint N1 uses: https://nylas.com/cloud/docs#streaming_delta_updates
You can also find out more info from the Sync Engine the Nylas team has open sourced

With this model, we should be expecting Nylas to deliver emails faster than other clients. But there is a significant delay in receiving a new email. I had to switch to Thunderbird time to time when there was some urgency in receiving a new email. Look forward to some sort of improvement on this.

Most IMAP clients use the same exact process to retrieve new mail. Either using the IDLE command or reconnecting every 5 minutes and checking the UIDVALIDITY/MODSEQ values.

As far as other providers (non-IMAP Gmail, Outlook, Exchange) which use APIs instead of the IMAP protocol, not sure how the sync-engine manages those connections.

It also seems like when I archive a bunch of messages, or leave the client open for a week or so, any action I perform that requires a sync is 1 step behind.

e.x.
archive message a -- nothing happens (says it is applying labels)
archive message b -- message a is removed from the list, but message b remains
and so on

The issue will resolve itself if I reload the client, but it still feels like a manual sync would help catch the client back up.

@adambullmer if anything, thats a sync issue bug in Nylas and adding a "Sync" button (which may not even fix that issue) would just be a hack, IMO.

I'm using Nylas 0.4.40-85cf726 with Gmail, and I experience an example mentioned above where I'm waiting for some confirmation or verification email. It isn't a huge delay, but it's long enough that I give up waiting for N1 and open Gmail in a browser. The email is always waiting in the web client, and it usually appears in N1 a few minutes later.

If this happens the Gmail/Inbox webui (which it does occasionally), I'm used to hitting the inbox button on the left hand side or using the keyboard command "g then i" which seems to refresh the mail. I was working around this in N1 before by switching the account view (cmd+2 then cmd+1), and this seemed to refresh things, but that doesn't happen any more.

I did find myself closing and reopening N1 several times this morning in an attempt to sync my gmail folder for priority github messages. So far, that folder has yet to sync with what I can see in the gmail webapp or on my phone.

Incremental, streaming updates for new mail is all well and good (when it works properly), but in the case where N1 was closed and I do some action on another email client (Phone or Thunderbird), N1 needs some process to go back through all the messages it thinks are in that folder and verify that they are still indeed in that folder. Some button to "refresh folder contents" (not just "check for new mail in this folder") would be very useful.

Hey! I'm going to close this issue—@KevinMartin is correct that we use a streaming connection (not just for new mail, but for updates to threads and folders), and delays in the updates are likely to be delays in the back-end, which wouldn't be fixed with this button. Instead, we're going to work on improving performance for mail sync so that it's faster and more reliable. Thanks!

So what case do we follow if we want updates on progress made to that back-end process?

@MidnightLightning when I ran into this issue, I took the most logical step: _delete the account_ from N1 and recreate it again. :smile:

@Avinash-Bhat, that seems like it would just re-add all my actions to the end of the queue on the server to be synced. The Nylas members have reported that this is server-side issue, so deleting and re-adding an account on the client-side probably has no real impact on this issue, and may make it worse (putting more actions on the already-overloaded queue).

I'd like to give this a bump; because I'm still not getting mail in real time. In some cases mail is delayed 15 minutes; or doesn't come at all unless I close+re-open the app. This used to only happen once in while, but now it's everyday 😞

It's NOT streamed/real time as you claim, it just refreshes every now and then. I have to use Developer → Reload as a workaround just to be able to manually refresh it, and then the e-mail comes in.

Chill dude; I never _claimed_ it was streamed in real time. Most other clients seem to show new emails faster than Nylas N1. The "real-time" i'm referring to would be the normal average of my other email clients' email retrieval. In which case, I would prefer a manual "sync" so I can bind it to a keystroke and refresh. I already do a _Developer_ => _Reload_ ; however, this reloads the entire app.

And I was only speaking of streaming in the sense of what I read prior:
As Jackie said above, (on Jul 28), they'll be working to get their _streaming connection_ performance up.

Oh, that was directed at Nylas, not at you, robjac! Sorry for the confusion.

@Jop-V and @robjac—the streaming connection doesn't necessarily mean it's faster than other clients; it's just a description of how we connect to our back-end. We aren't refreshing every few minutes, but the presence of the back-end does introduce a delay (usually just a few seconds). If you need to reload the whole app, that's a different bug, and you should email us at [email protected] with details so that we can see what's wrong!

What's wrong is that there isn't a button to reload _just the e-mail_ rather than the whole app..

@Jop-V We would much rather fix the bug that you're having than build a hacky workaround! Some people in this thread are having issues with the back-end—in that case, adding a reload button won't fix anything. But it sounds like you're having an issue with the client's streaming connection working after initial sync, so I think it probably makes more sense to find out why that's happening and get the connection working again than it does to add a button to manually sync each time.

@jackiehluo I think the main issue is a lack of meaningful UI feedback. The solution suggested above, of a "last synced (X minutes / seconds) ago" would be much better than nothing at all. I can say this was one of the reasons I ended up switching away eventually from N1.

Attempting to fix the underlying issue is well and good, but please don’t underestimate people’s needs to confirm that what they see is actually up to date. Nine months later, and there’s still no ‘Last synced’ label, nor an OCD-friendly way to perform a manual refresh.

At the very least, you could offer up an official plugin for this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nihil21 picture nihil21  Â·  4Comments

dariosm picture dariosm  Â·  4Comments

petrk94 picture petrk94  Â·  4Comments

hfossli picture hfossli  Â·  3Comments

Damien101 picture Damien101  Â·  3Comments