From 5ec1d4868472a8284d9bc0bb4525924599c41fb0 Mon Sep 17 00:00:00 2001 From: Christine Spang Date: Thu, 16 Feb 2017 15:02:47 -0800 Subject: [PATCH 1/6] fix(linux-build): Change package name to Nylas Mail Need this in order to allow parallel installation of Nylas Pro and Nylas Mail. --- ...nylas.desktop.in => nylas-mail.desktop.in} | 4 +- build/resources/linux/nylas.sh | 115 ------------------ build/tasks/installer-linux-task.js | 6 +- package.json | 2 +- script/mkdeb | 20 +-- 5 files changed, 16 insertions(+), 131 deletions(-) rename build/resources/linux/{nylas.desktop.in => nylas-mail.desktop.in} (86%) delete mode 100755 build/resources/linux/nylas.sh diff --git a/build/resources/linux/nylas.desktop.in b/build/resources/linux/nylas-mail.desktop.in similarity index 86% rename from build/resources/linux/nylas.desktop.in rename to build/resources/linux/nylas-mail.desktop.in index 950a2ef4fb..fe6d68f2e8 100644 --- a/build/resources/linux/nylas.desktop.in +++ b/build/resources/linux/nylas-mail.desktop.in @@ -2,8 +2,8 @@ Name=<%= productName %> Comment=<%= description %> GenericName=<%= productName %> -Exec=<%= linuxShareDir %>/nylas %U -Icon=nylas +Exec=/usr/bin/nylas-mail %U +Icon=nylas-mail Type=Application StartupNotify=true StartupWMClass=<%= productName %> diff --git a/build/resources/linux/nylas.sh b/build/resources/linux/nylas.sh deleted file mode 100755 index 6761458a99..0000000000 --- a/build/resources/linux/nylas.sh +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/bash - -if [ "$(uname)" == 'Darwin' ]; then - OS='Mac' -elif [ "$(expr substr $(uname -s) 1 5)" == 'Linux' ]; then - OS='Linux' -elif [ "$(expr substr $(uname -s) 1 10)" == 'MINGW32_NT' ]; then - OS='Cygwin' -else - echo "Your platform ($(uname -a)) is not supported." - exit 1 -fi - -while getopts ":wtfvh-:" opt; do - case "$opt" in - -) - case "${OPTARG}" in - wait) - WAIT=1 - ;; - help|version) - REDIRECT_STDERR=1 - EXPECT_OUTPUT=1 - ;; - foreground|test) - EXPECT_OUTPUT=1 - ;; - esac - ;; - w) - WAIT=1 - ;; - h|v) - REDIRECT_STDERR=1 - EXPECT_OUTPUT=1 - ;; - f|t) - EXPECT_OUTPUT=1 - ;; - esac -done - -if [ $REDIRECT_STDERR ]; then - exec 2> /dev/null -fi - -if [ $EXPECT_OUTPUT ]; then - export ELECTRON_ENABLE_LOGGING=1 -fi - -if [ $OS == 'Mac' ]; then - NYLAS_APP_NAME="Nylas Mail.app" - - if [ -z "${NYLAS_PATH}" ]; then - # If NYLAS_PATH isnt set, check /Applications and then ~/Applications for Nylas Mail.app - if [ -x "/Applications/$NYLAS_APP_NAME" ]; then - NYLAS_PATH="/Applications" - elif [ -x "$HOME/Applications/$NYLAS_APP_NAME" ]; then - NYLAS_PATH="$HOME/Applications" - else - # We havent found an Nylas Mail.app, use spotlight to search for N1 - NYLAS_PATH="$(mdfind "kMDItemCFBundleIdentifier == 'com.nylas.nylas-mail'" | grep -v ShipIt | head -1 | xargs -0 dirname)" - - # Exit if N1 can't be found - if [ ! -x "$NYLAS_PATH/$NYLAS_APP_NAME" ]; then - echo "Cannot locate 'Nylas Mail.app', it is usually located in /Applications. Set the NYLAS_PATH environment variable to the directory containing 'Nylas Mail.app'." - exit 1 - fi - fi - fi - - if [ $EXPECT_OUTPUT ]; then - "$NYLAS_PATH/$NYLAS_APP_NAME/Contents/MacOS/Nylas" --executed-from="$(pwd)" --pid=$$ "$@" - exit $? - else - open -a "$NYLAS_PATH/$NYLAS_APP_NAME" -n --args --executed-from="$(pwd)" --pid=$$ --path-environment="$PATH" "$@" - fi -elif [ $OS == 'Linux' ]; then - SCRIPT=$(readlink -f "$0") - USR_DIRECTORY=$(readlink -f $(dirname $SCRIPT)/..) - - NYLAS_PATH="$USR_DIRECTORY/share/nylas/nylas-mail" - NYLAS_HOME="${NYLAS_HOME:-$HOME/.nylas-mail}" - mkdir -p "$NYLAS_HOME" - - : ${TMPDIR:=/tmp} - - [ -x "$NYLAS_PATH" ] || NYLAS_PATH="$TMPDIR/nylas-build/Nylas/nylas" - - if [ $EXPECT_OUTPUT ]; then - "$NYLAS_PATH" --executed-from="$(pwd)" --pid=$$ "$@" - exit $? - else - ( - nohup "$NYLAS_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$NYLAS_HOME/nohup.out" 2>&1 - if [ $? -ne 0 ]; then - cat "$NYLAS_HOME/nohup.out" - exit $? - fi - ) & - fi -fi - -# Exits this process when N1 exits -on_die() { - exit 0 -} -trap 'on_die' SIGQUIT SIGTERM - -# If the wait flag is set, don't exit this process until N1 tells it to. -if [ $WAIT ]; then - while true; do - sleep 1 - done -fi diff --git a/build/tasks/installer-linux-task.js b/build/tasks/installer-linux-task.js index c4915363c7..84c419a1c9 100644 --- a/build/tasks/installer-linux-task.js +++ b/build/tasks/installer-linux-task.js @@ -59,7 +59,7 @@ module.exports = (grunt) => { writeFromTemplate(specInFilePath, templateData) // This populates nylas.desktop - const desktopInFilePath = path.join(linuxAssetsDir, 'nylas.desktop.in') + const desktopInFilePath = path.join(linuxAssetsDir, 'nylas-mail.desktop.in') writeFromTemplate(desktopInFilePath, templateData) const cmd = path.join('script', 'mkrpm') @@ -92,14 +92,14 @@ module.exports = (grunt) => { name: grunt.config('appJSON').name, description: grunt.config('appJSON').description, productName: grunt.config('appJSON').productName, - linuxShareDir: '/usr/share/nylas', + linuxShareDir: '/usr/share/nylas-mail', arch: arch, section: 'devel', maintainer: 'Nylas Team ', installedSize: installedSize, } writeFromTemplate(path.join(linuxAssetsDir, 'debian', 'control.in'), data) - writeFromTemplate(path.join(linuxAssetsDir, 'nylas.desktop.in'), data) + writeFromTemplate(path.join(linuxAssetsDir, 'nylas-mail.desktop.in'), data) const icon = path.join('build', 'resources', 'nylas.png') const cmd = path.join('script', 'mkdeb'); diff --git a/package.json b/package.json index a37b815f58..70c76c252f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "nylas", + "name": "nylas-mail", "productName": "Nylas Mail", "version": "1.0.28", "description": "The best email app for people and teams at work", diff --git a/script/mkdeb b/script/mkdeb index 3cb925ec7f..fe9b005314 100755 --- a/script/mkdeb +++ b/script/mkdeb @@ -22,7 +22,7 @@ TARGET="$TARGET_ROOT/nylas-$VERSION-$ARCH" mkdir -m $FILE_MODE -p "$TARGET/usr" mkdir -m $FILE_MODE -p "$TARGET/usr/share" -cp -r "$APP_CONTENTS_DIRECTORY" "$TARGET/usr/share/nylas" +cp -r "$APP_CONTENTS_DIRECTORY" "$TARGET/usr/share/nylas-mail" mkdir -m $FILE_MODE -p "$TARGET/DEBIAN" cp "$OUTPUT_PATH/control" "$TARGET/DEBIAN/control" @@ -31,28 +31,28 @@ cp "$LINUX_ASSETS_DIRECTORY/debian/postinst" "$TARGET/DEBIAN/postinst" cp "$LINUX_ASSETS_DIRECTORY/debian/postrm" "$TARGET/DEBIAN/postrm" mkdir -m $FILE_MODE -p "$TARGET/usr/bin" -cp "$LINUX_ASSETS_DIRECTORY/nylas.sh" "$TARGET/usr/bin/nylas" -chmod +x "$TARGET/usr/bin/nylas" +ln -s "../share/nylas-mail/nylas" "$TARGET/usr/bin/nylas-mail" +chmod +x "$TARGET/usr/bin/nylas-mail" mkdir -m $FILE_MODE -p "$TARGET/usr/share/applications" -cp "$OUTPUT_PATH/nylas.desktop" "$TARGET/usr/share/applications" +cp "$OUTPUT_PATH/nylas-mail.desktop" "$TARGET/usr/share/applications" mkdir -m $FILE_MODE -p "$TARGET/usr/share/pixmaps" -cp "$ICON_FILE" "$TARGET/usr/share/pixmaps" +cp "$ICON_FILE" "$TARGET/usr/share/pixmaps/nylas-mail.png" mkdir -m $FILE_MODE -p "$TARGET/usr/share/icons/hicolor" for i in 256 128 64 32 16; do mkdir -p "$TARGET/usr/share/icons/hicolor/${i}x${i}/apps" - cp "$LINUX_ASSETS_DIRECTORY/icons/${i}.png" "$TARGET/usr/share/icons/hicolor/${i}x${i}/apps/nylas.png" + cp "$LINUX_ASSETS_DIRECTORY/icons/${i}.png" "$TARGET/usr/share/icons/hicolor/${i}x${i}/apps/nylas-mail.png" done -# Copy generated LICENSE.md to /usr/share/doc/nylas/copyright -mkdir -m $FILE_MODE -p "$TARGET/usr/share/doc/nylas" -cp "$TARGET/usr/share/nylas/LICENSE" "$TARGET/usr/share/doc/nylas/copyright" +# Copy generated LICENSE.md to /usr/share/doc/nylas-mail/copyright +mkdir -m $FILE_MODE -p "$TARGET/usr/share/doc/nylas-mail" +cp "$TARGET/usr/share/nylas-mail/LICENSE" "$TARGET/usr/share/doc/nylas-mail/copyright" # Add lintian overrides mkdir -m $FILE_MODE -p "$TARGET/usr/share/lintian/overrides" -cp "$ROOT/build/resources/linux/debian/lintian-overrides" "$TARGET/usr/share/lintian/overrides/nylas" +cp "$ROOT/build/resources/linux/debian/lintian-overrides" "$TARGET/usr/share/lintian/overrides/nylas-mail" # Remove group write from all files chmod -R g-w "$TARGET"; From 51ecc4a8cac0300f4de764ed1e691ff6eec80609 Mon Sep 17 00:00:00 2001 From: Christine Spang Date: Thu, 16 Feb 2017 15:52:44 -0800 Subject: [PATCH 2/6] fix(cli): s/n1/nylas-mail/ --- src/browser/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/browser/main.js b/src/browser/main.js index eb2011d082..74621174f5 100644 --- a/src/browser/main.js +++ b/src/browser/main.js @@ -56,17 +56,17 @@ const setupErrorLogger = (args = {}) => { const declareOptions = (argv) => { const optimist = require('optimist'); const options = optimist(argv); - options.usage("Nylas Mail v" + (app.getVersion()) + "\n\nUsage: n1 [options]\n\nRun N1: The open source extensible email client\n\n`n1 --dev` to start the client in dev mode.\n\n`n1 --test` to run unit tests."); + options.usage("Nylas Mail v" + (app.getVersion()) + "\n\nUsage: nylas-mail [options]\n\nRun Nylas Mail: The open source extensible email client\n\n`nylas-mail --dev` to start the client in dev mode.\n\n`n1 --test` to run unit tests."); options.alias('d', 'dev').boolean('d').describe('d', 'Run in development mode.'); options.alias('t', 'test').boolean('t').describe('t', 'Run the specified specs and exit with error code on failures.'); options.boolean('safe').describe('safe', 'Do not load packages from ~/.nylas-mail/packages or ~/.nylas/dev/packages.'); options.alias('h', 'help').boolean('h').describe('h', 'Print this usage message.'); options.alias('l', 'log-file').string('l').describe('l', 'Log all test output to file.'); - options.alias('c', 'config-dir-path').string('c').describe('c', 'Override the path to the N1 configuration directory'); + options.alias('c', 'config-dir-path').string('c').describe('c', 'Override the path to the Nylas Mail configuration directory'); options.alias('s', 'spec-directory').string('s').describe('s', 'Override the directory from which to run package specs'); options.alias('f', 'spec-file-pattern').string('f').describe('f', 'Override the default file regex to determine which tests should run (defaults to "-spec\.(coffee|js|jsx|cjsx|es6|es)$" )'); options.alias('v', 'version').boolean('v').describe('v', 'Print the version.'); - options.alias('b', 'background').boolean('b').describe('b', 'Start N1 in the background'); + options.alias('b', 'background').boolean('b').describe('b', 'Start Nylas Mail in the background'); return options; }; From c745ec4e421c31c4c40547affa9efc36e0e998c6 Mon Sep 17 00:00:00 2001 From: Christine Spang Date: Thu, 16 Feb 2017 16:57:33 -0800 Subject: [PATCH 3/6] fix(linux-build): Update rpm spec to use new package name --- build/resources/linux/redhat/nylas.spec.in | 38 +++++++++++----------- script/mkrpm | 4 +-- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/build/resources/linux/redhat/nylas.spec.in b/build/resources/linux/redhat/nylas.spec.in index b9981f549c..900e649f59 100644 --- a/build/resources/linux/redhat/nylas.spec.in +++ b/build/resources/linux/redhat/nylas.spec.in @@ -3,7 +3,7 @@ Version: <%= version %> Release: 0.1%{?dist} Summary: <%= description %> License: GPLv3 -URL: https://nylas.com/N1 +URL: https://github.com/nylas/nylas-mail AutoReqProv: no # Avoid libchromiumcontent.so missing dependency requires: libgnome-keyring @@ -12,29 +12,29 @@ requires: libgnome-keyring <%= description %> %install -mkdir -p %{buildroot}/usr/local/share/nylas -cp -r <%= contentsDir %>/* %{buildroot}/usr/local/share/nylas +mkdir -p %{buildroot}/usr/share/nylas-mail +cp -r <%= contentsDir %>/* %{buildroot}/usr/share/nylas-mail -mkdir -p %{buildroot}/usr/local/bin/ +mkdir -p %{buildroot}/usr/bin/ -cp <%= linuxAssetsDir %>/nylas.sh %{buildroot}/usr/local/bin/nylas -chmod 755 %{buildroot}/usr/local/bin/nylas +ln -s ../share/nylas-mail/nylas %{buildroot}/usr/bin/nylas-mail +chmod 755 %{buildroot}/usr/bin/nylas-mail -mkdir -p %{buildroot}/usr/local/share/applications/ -mv nylas.desktop %{buildroot}/usr/local/share/applications/ +mkdir -p %{buildroot}/usr/share/applications/ +mv nylas-mail.desktop %{buildroot}/usr/share/applications/ for s in 16 32 64 128 256 512; do - mkdir -p %{buildroot}/usr/local/share/icons/hicolor/${s}x${s}/apps - cp -p <%= linuxAssetsDir %>/icons/${s}.png %{buildroot}/usr/local/share/icons/hicolor/${s}x${s}/apps/nylas.png + mkdir -p %{buildroot}/usr/share/icons/hicolor/${s}x${s}/apps + cp -p <%= linuxAssetsDir %>/icons/${s}.png %{buildroot}/usr/share/icons/hicolor/${s}x${s}/apps/nylas-mail.png done %files -/usr/local/bin/nylas -/usr/local/share/nylas -/usr/local/share/applications/nylas.desktop -/usr/local/share/icons/hicolor/16x16/apps/nylas.png -/usr/local/share/icons/hicolor/32x32/apps/nylas.png -/usr/local/share/icons/hicolor/64x64/apps/nylas.png -/usr/local/share/icons/hicolor/128x128/apps/nylas.png -/usr/local/share/icons/hicolor/256x256/apps/nylas.png -/usr/local/share/icons/hicolor/512x512/apps/nylas.png +/usr/bin/nylas-mail +/usr/share/nylas-mail +/usr/share/applications/nylas-mail.desktop +/usr/share/icons/hicolor/16x16/apps/nylas-mail.png +/usr/share/icons/hicolor/32x32/apps/nylas-mail.png +/usr/share/icons/hicolor/64x64/apps/nylas-mail.png +/usr/share/icons/hicolor/128x128/apps/nylas-mail.png +/usr/share/icons/hicolor/256x256/apps/nylas-mail.png +/usr/share/icons/hicolor/512x512/apps/nylas-mail.png diff --git a/script/mkrpm b/script/mkrpm index 0b8ab1cfb9..c542b9e6fa 100755 --- a/script/mkrpm +++ b/script/mkrpm @@ -22,9 +22,7 @@ mkdir -p $RPM_BUILD_ROOT/RPMS cp -r "$APP_CONTENTS_DIRECTORY/"* "$RPM_BUILD_ROOT/BUILD" cp -r "$LINUX_ASSETS_DIRECTORY/icons" "$RPM_BUILD_ROOT/BUILD" cp "$BUILD_DIRECTORY/nylas.spec" "$RPM_BUILD_ROOT/SPECS" -cp "$LINUX_ASSETS_DIRECTORY/nylas.sh" "$RPM_BUILD_ROOT/BUILD" -cp "$RPM_BUILD_ROOT/BUILD/nylas.sh" "$RPM_BUILD_ROOT/BUILD/nylas" -cp "$BUILD_DIRECTORY/nylas.desktop" "$RPM_BUILD_ROOT/BUILD" +cp "$BUILD_DIRECTORY/nylas-mail.desktop" "$RPM_BUILD_ROOT/BUILD" rpmbuild -ba "$BUILD_DIRECTORY/nylas.spec" cp $RPM_BUILD_ROOT/RPMS/$ARCH/nylas-*.rpm "$BUILD_DIRECTORY" From 7890b92285aedf4b6e8a31da718c2acc41568fd7 Mon Sep 17 00:00:00 2001 From: Juan Tejada Date: Thu, 16 Feb 2017 18:32:49 -0800 Subject: [PATCH 4/6] update(changelog) --- CHANGELOG.md | 62 ++++++++++++++++++---------------------------------- 1 file changed, 21 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b41c6399f3..2c35323be1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,47 +2,27 @@ ### 1.0.28 (2/16/2017) -- nylas-mail: - - + [battery] Add BatteryStatusManager - + fix(exports) Add backoff schedulers - + feat(offline) Re add offline status notification - + reafctor(scheduler): Move SearchIndexer -> SearchIndexScheduler - + feat(backoff-scheduler): Add a backoff scheduler service - -- K2: - - + [local-sync] :art: sync loop error handler - + [sentry] Don't use breadcrumbs in dev mode - + [cloud-api] remove latest_cursor endpoint - + [cloud-api] Log error info on 5xx errors - + [local-sync] Refresh Google OAuth2 tokens when Invalid Credentials occurs in sync loop - + Add TODOs about retries in sending - + [local-sync] Add exponential backoff when retrying syncback tasks - + [SFDC] Update SalesforceSearchIndexer for new search indexing - + [cloud-api,cloud-workers,local-sync] Bump hapi version - + [cloud-api] Reduce request timing precision - + Bump pm2 version to 2.4.0 - + [cloud-api] KEEP Timeout streaming API connections every 15 minutes - + Revert [cloud-api] Timeout streaming API connections every 15 minutes - + [cloud-\*] Properly listen to stream disconnect events to close redis connections - + [cloud-core, cloud-api] add logging to delta connection - + [cloud-api] Timeout streaming API connections every 15 minutes - + [isomorphic-core] add accountId index definition to Transaction table - + [cloud-api] recover from bad error from /n1/user - + [local-sync] :art: comment - + [local-sync] syncback(Part 5): Always keep retrying tasks if error is retryable - + [local-sync] :fire: Message syncback tasks - + [cloud-api] Change an extension from .js to .es6 - + [local-sync] syncback(Part 4): Don't always mark INPROGRESS tasks as failed at beginning of sync - + [local-sync] syncback(Part 3): Fixup - + [local-sync] syncback(Part 2): Reinstate send tasks back into the sync loop - + [cloud-api] Add metadata tests - + [local-sync, cloud-api] Add logic to handle thread metadata - + [local-sync] syncback(Part 1): Refactor syncback-task-helpers - + [iso-core] Detect more offline errors when sending - + [local-sync] Add a better reason when waking sync for syncback - + [local-sync] More retryable IMAP errors +- Fixes: + + + Fix offline notification bug that caused outage! + + Cloud api fixes for outage! + + We now properly handle gmail auth token errors in the middle of the sync loop. This means less red boxes for users! + + Less battery usage when initial sync has completed! + + No more errors when saving sent messages to sent folders (`auth or accountId` errors) + + No more `Lingering tasks in progress marked as failed errors` + + Syncback tasks will continue retrying even after closing app + + Syncback tasks retry more aggressively + + Detect more offline errors when sending, sending is more reliable + + Imap connection pooling (yet to land) + + More retryable IMAP errors, means less red boxes for users + + Offline notification now shows itself when we’re actually offline, shows countdown for next reconnect attempt + +- Development: + + + More tests + + Don't use breadcrumbs in dev mode + + Add a better reason when waking sync for syncback in the logs + + BackoffScheduler, BatteryManager added for reusability ### 1.0.27 (2/14/17) From 0a100dd7f6de66e9ceceb51adad00d72ae11899e Mon Sep 17 00:00:00 2001 From: Juan Tejada Date: Thu, 23 Feb 2017 11:05:58 -0800 Subject: [PATCH 5/6] Update changelog --- CHANGELOG.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c35323be1..2a0494fb15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,25 @@ # Nylas Mail Changelog +### 1.0.29 (2/21/2017) + +- Fixes: + + + You can now click inline images in messages to open them + + More IMAP errors have been identified as retryable, which means users will + see less errors when syncing an account + + Improve performance of thread search indexing queries + + Correctly catch Invalid Login errors when sending + +- Development: + + + Developer bar in Worker window now shows single delta connection + + More code converted to Javascript + ### 1.0.28 (2/16/2017) - Fixes: - + Fix offline notification bug that caused outage! - + Cloud api fixes for outage! + + Fix offline notification bug that caused api outage + We now properly handle gmail auth token errors in the middle of the sync loop. This means less red boxes for users! + Less battery usage when initial sync has completed! + No more errors when saving sent messages to sent folders (`auth or accountId` errors) From 7d093a9a20eb95c7c5188b662fb42038fab64462 Mon Sep 17 00:00:00 2001 From: BinHong Lee Date: Thu, 6 Apr 2017 10:53:56 -0700 Subject: [PATCH 6/6] Fix broken link to Kleinstein theme in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0192fe7f77..0e5ad273f2 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ The Nylas Mail user interface is styled using CSS, which means it's easy to modi - [Monokai](https://github.com/dcondrey/n1-monokai) - [Agapanthus](https://github.com/taniadaniela/n1-agapanthus)—Inbox-inspired theme - [Stripe](https://github.com/oeaeee/n1-stripe) -- [Kleinstein] (https://github.com/diklein/Kleinstein)—Hide the account list sidebar +- [Kleinstein](https://github.com/diklein/Kleinstein)—Hide the account list sidebar - [BoraBora](https://github.com/arimai/N1-BoraBora) - [Honeyduke](https://github.com/arimai/n1-honeyduke) - [Snow](https://github.com/Wattenberger/N1-snow-theme)