Merge pull request #1866 from mattermost/merge-1.9

Merge release 1.9 to master
This commit is contained in:
Elias Nahum 2018-07-03 12:34:15 -04:00 committed by GitHub
commit c8c26fd00d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 65 additions and 40 deletions

View file

@ -113,7 +113,7 @@ android {
applicationId "com.mattermost.rnbeta"
minSdkVersion 21
targetSdkVersion 23
versionCode 118
versionCode 119
versionName "1.10.0"
ndk {
abiFilters "armeabi-v7a", "x86"

View file

@ -20,7 +20,7 @@ import {createSentryMiddleware} from 'app/utils/sentry/middleware';
import mattermostBucket from 'app/mattermost_bucket';
import Config from 'assets/config';
import {messageRetention, shareExtensionData} from './middleware';
import {messageRetention} from './middleware';
import {transformSet} from './utils';
function getAppReducer() {
@ -208,6 +208,11 @@ export default function configureAppStore(initialState) {
},
]));
// When logging out remove the data stored in the bucket
mattermostBucket.removePreference('cert', Config.AppGroupId);
mattermostBucket.removePreference('emm', Config.AppGroupId);
mattermostBucket.removeFile('entities', Config.AppGroupId);
setTimeout(() => {
purging = false;
}, 500);
@ -267,7 +272,7 @@ export default function configureAppStore(initialState) {
},
};
const additionalMiddleware = [createSentryMiddleware(), messageRetention, shareExtensionData];
const additionalMiddleware = [createSentryMiddleware(), messageRetention];
return configureStore(initialState, appReducer, offlineOptions, getAppReducer, {
additionalMiddleware,
});

View file

@ -3,12 +3,8 @@
import DeviceInfo from 'react-native-device-info';
import {UserTypes} from 'mattermost-redux/action_types';
import {ViewTypes} from 'app/constants';
import initialState from 'app/initial_state';
import mattermostBucket from 'app/mattermost_bucket';
import Config from 'assets/config';
import {
captureException,
@ -354,22 +350,6 @@ function cleanupState(action, keepCurrent = false) {
};
}
export function shareExtensionData() {
return (next) => (action) => {
// allow other middleware to do their things
const nextAction = next(action);
switch (action.type) {
case UserTypes.LOGOUT_SUCCESS:
mattermostBucket.removePreference('cert', Config.AppGroupId);
mattermostBucket.removePreference('emm', Config.AppGroupId);
mattermostBucket.removeFile('entities', Config.AppGroupId);
break;
}
return nextAction;
};
}
function removePendingPost(pendingPostIds, id) {
const pendingIndex = pendingPostIds.indexOf(id);
if (pendingIndex !== -1) {

View file

@ -24,16 +24,16 @@ import {
import {app, store} from 'app/mattermost';
const errorHandler = (e, isFatal) => {
console.warn('Handling Javascript error ' + JSON.stringify(e)); // eslint-disable-line no-console
const {dispatch, getState} = store;
console.warn('Handling Javascript error ', e); // eslint-disable-line no-console
const {dispatch} = store;
captureException(e, LOGGER_JAVASCRIPT, store);
const translations = app.getTranslations();
closeWebSocket()(dispatch, getState);
dispatch(closeWebSocket());
if (Client4.getUrl()) {
logError(e)(dispatch, getState);
dispatch(logError(e));
}
if (isFatal) {
@ -44,7 +44,7 @@ const errorHandler = (e, isFatal) => {
text: translations['mobile.error_handler.button'],
onPress: () => {
// purge the store
purgeOfflineStore()(dispatch, getState);
dispatch(purgeOfflineStore());
},
}],
{cancelable: false}

View file

@ -45,9 +45,11 @@ function getDsn() {
}
export function captureException(error, logger, store) {
capture(() => {
Sentry.captureException(error, {logger});
}, store);
if (error && logger && store) {
capture(() => {
Sentry.captureException(error, {logger});
}, store);
}
}
export function captureExceptionWithoutState(err, logger) {
@ -55,17 +57,21 @@ export function captureExceptionWithoutState(err, logger) {
return;
}
try {
Sentry.captureException(err, {logger});
} catch (error) {
// do nothing...
if (err && logger) {
try {
Sentry.captureException(err, {logger});
} catch (error) {
// do nothing...
}
}
}
export function captureMessage(message, logger, store) {
capture(() => {
Sentry.captureMessage(message, {logger});
}, store);
if (message && logger && store) {
capture(() => {
Sentry.captureMessage(message, {logger});
}, store);
}
}
// Wrapper function to any calls to Sentry so that we can gather any necessary extra data

View file

@ -2532,7 +2532,11 @@
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
<<<<<<< HEAD
CURRENT_PROJECT_VERSION = 118;
=======
CURRENT_PROJECT_VERSION = 119;
>>>>>>> release-1.9
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
ENABLE_BITCODE = NO;
@ -2582,7 +2586,11 @@
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
<<<<<<< HEAD
CURRENT_PROJECT_VERSION = 118;
=======
CURRENT_PROJECT_VERSION = 119;
>>>>>>> release-1.9
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
ENABLE_BITCODE = NO;

View file

@ -19,7 +19,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<<<<<<< HEAD
<string>1.10.0</string>
=======
<string>1.9.3</string>
>>>>>>> release-1.9
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
@ -34,7 +38,11 @@
</dict>
</array>
<key>CFBundleVersion</key>
<<<<<<< HEAD
<string>118</string>
=======
<string>119</string>
>>>>>>> release-1.9
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>

View file

@ -81,7 +81,9 @@ RCT_EXPORT_METHOD(removePreference:(NSString *) key
if(![fileManager fileExistsAtPath:filePath]) {
[fileManager createFileAtPath:filePath contents:nil attributes:nil];
}
[content writeToFile:filePath atomically:YES encoding:NSUTF8StringEncoding error:nil];
if ([content length] > 0) {
[content writeToFile:filePath atomically:YES encoding:NSUTF8StringEncoding error:nil];
}
}
-(NSString *)readFromFile:(NSString *)fileName appGroupId:(NSString *)appGroupId {
@ -107,7 +109,9 @@ RCT_EXPORT_METHOD(removePreference:(NSString *) key
-(void) setPreference:(NSString *)key value:(NSString *) value appGroupId:(NSString*)appGroupId {
NSUserDefaults* bucket = [self bucketByName: appGroupId];
[bucket setObject:value forKey:key];
if ([key length] > 0 && [value length] > 0) {
[bucket setObject:value forKey:key];
}
}
-(id) getPreference:(NSString *)key appGroupId:(NSString*)appGroupId {

View file

@ -21,9 +21,15 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<<<<<<< HEAD
<string>1.10.0</string>
<key>CFBundleVersion</key>
<string>118</string>
=======
<string>1.9.3</string>
<key>CFBundleVersion</key>
<string>119</string>
>>>>>>> release-1.9
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>

View file

@ -15,10 +15,18 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<<<<<<< HEAD
<string>1.10.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>118</string>
=======
<string>1.9.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>119</string>
>>>>>>> release-1.9
</dict>
</plist>