Upgrade deps (#5796)
This commit is contained in:
parent
fbd8b92194
commit
c8d7d4c528
15 changed files with 373 additions and 404 deletions
|
|
@ -242,7 +242,7 @@ const withPosts = withObservables(['channelId', 'forceQueryAfterAppState'], ({da
|
|||
),
|
||||
posts: database.get<PostsInChannelModel>(POSTS_IN_CHANNEL).query(
|
||||
Q.where('channel_id', channelId),
|
||||
Q.experimentalSortBy('latest', Q.desc),
|
||||
Q.sortBy('latest', Q.desc),
|
||||
).observeWithColumns(['earliest', 'latest']).pipe(
|
||||
switchMap((postsInChannel) => {
|
||||
if (!postsInChannel.length) {
|
||||
|
|
@ -256,7 +256,7 @@ const withPosts = withObservables(['channelId', 'forceQueryAfterAppState'], ({da
|
|||
Q.where('channel_id', channelId),
|
||||
Q.where('create_at', Q.between(earliest, latest)),
|
||||
),
|
||||
Q.experimentalSortBy('create_at', Q.desc),
|
||||
Q.sortBy('create_at', Q.desc),
|
||||
).observe();
|
||||
}),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -99,8 +99,8 @@ export default class PostModel extends Model {
|
|||
/** postsInThread: The thread to which this post is associated */
|
||||
@lazy postsInThread = this.collections.get(POSTS_IN_THREAD).query(
|
||||
Q.where('root_id', this.rootId || this.id),
|
||||
Q.experimentalSortBy('latest', Q.desc),
|
||||
Q.experimentalTake(1),
|
||||
Q.sortBy('latest', Q.desc),
|
||||
Q.take(1),
|
||||
) as Query<PostInThreadModel>;
|
||||
|
||||
/** files: All the files associated with this Post */
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import {createPostsChain} from '@database/operator/utils/post';
|
|||
|
||||
import ServerDataOperator from '..';
|
||||
|
||||
Q.experimentalSortBy = jest.fn().mockImplementation((field) => {
|
||||
Q.sortBy = jest.fn().mockImplementation((field) => {
|
||||
return Q.where(field, Q.gte(0));
|
||||
});
|
||||
describe('*** Operator: Post Handlers tests ***', () => {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ const PostsInChannelHandler = (superclass: any) => class extends superclass {
|
|||
// Find the records in the PostsInChannel table that have a matching channel_id
|
||||
const chunks = (await this.database.get(POSTS_IN_CHANNEL).query(
|
||||
Q.where('channel_id', channelId),
|
||||
Q.experimentalSortBy('latest', Q.desc),
|
||||
Q.sortBy('latest', Q.desc),
|
||||
).fetch()) as PostsInChannelModel[];
|
||||
|
||||
// chunk length 0; then it's a new chunk to be added to the PostsInChannel table
|
||||
|
|
@ -130,7 +130,7 @@ const PostsInChannelHandler = (superclass: any) => class extends superclass {
|
|||
let recentChunk: PostsInChannelModel|undefined;
|
||||
const chunks = (await this.database.get(POSTS_IN_CHANNEL).query(
|
||||
Q.where('channel_id', firstPost.channel_id),
|
||||
Q.experimentalSortBy('latest', Q.desc),
|
||||
Q.sortBy('latest', Q.desc),
|
||||
).fetch()) as PostsInChannelModel[];
|
||||
|
||||
if (chunks.length) {
|
||||
|
|
@ -193,7 +193,7 @@ const PostsInChannelHandler = (superclass: any) => class extends superclass {
|
|||
// Find the records in the PostsInChannel table that have a matching channel_id
|
||||
const chunks = (await this.database.get(POSTS_IN_CHANNEL).query(
|
||||
Q.where('channel_id', channelId),
|
||||
Q.experimentalSortBy('latest', Q.desc),
|
||||
Q.sortBy('latest', Q.desc),
|
||||
).fetch()) as PostsInChannelModel[];
|
||||
|
||||
// chunk length 0; then it's a new chunk to be added to the PostsInChannel table
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ const PostsInThreadHandler = (superclass: any) => class extends superclass {
|
|||
const {firstPost, lastPost} = getPostListEdges(postsMap[rootId]);
|
||||
const chunks = (await this.database.get(POSTS_IN_THREAD).query(
|
||||
Q.where('root_id', rootId),
|
||||
Q.experimentalSortBy('latest', Q.desc),
|
||||
Q.sortBy('latest', Q.desc),
|
||||
).fetch()) as PostsInThreadModel[];
|
||||
|
||||
if (chunks.length) {
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ export const queryDefaultChannelForTeam = async (database: Database, teamId: str
|
|||
Q.where('delete_at', 0),
|
||||
Q.where('type', General.OPEN_CHANNEL),
|
||||
),
|
||||
Q.experimentalSortBy('display_name', Q.asc),
|
||||
Q.sortBy('display_name', Q.asc),
|
||||
).fetch();
|
||||
|
||||
const defaultChannel = myChannels.find((c) => c.name === General.DEFAULT_CHANNEL);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ export const queryPostsInChannel = (database: Database, channelId: string): Prom
|
|||
try {
|
||||
return database.get(POSTS_IN_CHANNEL).query(
|
||||
Q.where('channel_id', channelId),
|
||||
Q.experimentalSortBy('latest', Q.desc),
|
||||
Q.sortBy('latest', Q.desc),
|
||||
).fetch() as Promise<PostInChannelModel[]>;
|
||||
} catch {
|
||||
return Promise.resolve([] as PostInChannelModel[]);
|
||||
|
|
@ -65,7 +65,7 @@ export const queryPostsChunk = (database: Database, channelId: string, earliest:
|
|||
Q.where('create_at', Q.between(earliest, latest)),
|
||||
Q.where('delete_at', Q.eq(0)),
|
||||
),
|
||||
Q.experimentalSortBy('create_at', Q.desc),
|
||||
Q.sortBy('create_at', Q.desc),
|
||||
).fetch() as Promise<PostModel[]>;
|
||||
} catch {
|
||||
return Promise.resolve([] as PostModel[]);
|
||||
|
|
|
|||
601
package-lock.json
generated
601
package-lock.json
generated
File diff suppressed because it is too large
Load diff
46
package.json
46
package.json
|
|
@ -9,15 +9,15 @@
|
|||
"dependencies": {
|
||||
"@babel/runtime": "7.15.4",
|
||||
"@formatjs/intl-datetimeformat": "4.2.5",
|
||||
"@formatjs/intl-getcanonicallocales": "1.7.3",
|
||||
"@formatjs/intl-locale": "2.4.39",
|
||||
"@formatjs/intl-getcanonicallocales": "1.8.0",
|
||||
"@formatjs/intl-locale": "2.4.40",
|
||||
"@formatjs/intl-numberformat": "7.2.5",
|
||||
"@formatjs/intl-pluralrules": "4.1.5",
|
||||
"@formatjs/intl-relativetimeformat": "9.3.2",
|
||||
"@mattermost/react-native-emm": "1.1.5",
|
||||
"@mattermost/react-native-network-client": "github:mattermost/react-native-network-client",
|
||||
"@mattermost/react-native-paste-input": "0.3.0",
|
||||
"@nozbe/watermelondb": "0.23.0",
|
||||
"@mattermost/react-native-paste-input": "0.3.3",
|
||||
"@nozbe/watermelondb": "0.24.0",
|
||||
"@nozbe/with-observables": "1.4.0",
|
||||
"@react-native-community/art": "1.2.0",
|
||||
"@react-native-community/async-storage": "1.12.1",
|
||||
|
|
@ -25,12 +25,12 @@
|
|||
"@react-native-community/clipboard": "1.5.1",
|
||||
"@react-native-community/datetimepicker": "3.5.2",
|
||||
"@react-native-community/masked-view": "0.1.11",
|
||||
"@react-native-community/netinfo": "6.0.2",
|
||||
"@react-native-community/netinfo": "6.0.4",
|
||||
"@react-native-cookies/cookies": "6.0.11",
|
||||
"@react-navigation/bottom-tabs": "6.0.9",
|
||||
"@react-navigation/native": "6.0.6",
|
||||
"@rudderstack/rudder-sdk-react-native": "1.0.14",
|
||||
"@sentry/react-native": "3.1.1",
|
||||
"@sentry/react-native": "3.2.1",
|
||||
"@types/mime-db": "1.43.1",
|
||||
"commonmark": "0.30.0",
|
||||
"commonmark-react-renderer": "4.3.5",
|
||||
|
|
@ -43,19 +43,19 @@
|
|||
"moment-timezone": "0.5.33",
|
||||
"prop-types": "15.7.2",
|
||||
"react": "17.0.2",
|
||||
"react-intl": "5.20.13",
|
||||
"react-intl": "5.21.0",
|
||||
"react-native": "0.66.1",
|
||||
"react-native-android-open-settings": "1.3.0",
|
||||
"react-native-button": "3.0.1",
|
||||
"react-native-calendars": "1.1267.0",
|
||||
"react-native-device-info": "8.4.1",
|
||||
"react-native-document-picker": "7.1.0",
|
||||
"react-native-calendars": "1.1268.0",
|
||||
"react-native-device-info": "8.4.3",
|
||||
"react-native-document-picker": "7.1.1",
|
||||
"react-native-elements": "3.4.2",
|
||||
"react-native-exception-handler": "2.10.10",
|
||||
"react-native-fast-image": "8.5.11",
|
||||
"react-native-file-viewer": "2.1.4",
|
||||
"react-native-gesture-handler": "1.10.3",
|
||||
"react-native-haptic-feedback": "1.11.0",
|
||||
"react-native-haptic-feedback": "1.13.0",
|
||||
"react-native-hw-keyboard-event": "0.0.4",
|
||||
"react-native-keyboard-aware-scroll-view": "0.9.4",
|
||||
"react-native-keyboard-tracking-view": "5.7.0",
|
||||
|
|
@ -72,12 +72,12 @@
|
|||
"react-native-safe-area-context": "3.3.2",
|
||||
"react-native-screens": "3.8.0",
|
||||
"react-native-section-list-get-item-layout": "2.2.3",
|
||||
"react-native-share": "7.2.0",
|
||||
"react-native-share": "7.2.1",
|
||||
"react-native-slider": "0.11.0",
|
||||
"react-native-svg": "12.1.1",
|
||||
"react-native-unimodules": "0.14.8",
|
||||
"react-native-vector-icons": "8.1.0",
|
||||
"react-native-video": "5.2.0-alpha1",
|
||||
"react-native-vector-icons": "9.0.0",
|
||||
"react-native-video": "5.2.0",
|
||||
"react-native-webview": "11.14.1",
|
||||
"react-native-youtube": "2.0.2",
|
||||
"reanimated-bottom-sheet": "1.0.0-alpha.22",
|
||||
|
|
@ -104,10 +104,10 @@
|
|||
"@types/commonmark-react-renderer": "4.3.1",
|
||||
"@types/deep-equal": "1.0.1",
|
||||
"@types/jest": "27.0.2",
|
||||
"@types/lodash": "4.14.175",
|
||||
"@types/react": "17.0.30",
|
||||
"@types/lodash": "4.14.176",
|
||||
"@types/react": "17.0.33",
|
||||
"@types/react-intl": "3.0.0",
|
||||
"@types/react-native": "0.65.8",
|
||||
"@types/react-native": "0.66.1",
|
||||
"@types/react-native-button": "3.0.1",
|
||||
"@types/react-native-share": "3.3.3",
|
||||
"@types/react-native-video": "5.0.10",
|
||||
|
|
@ -116,15 +116,15 @@
|
|||
"@types/shallow-equals": "1.0.0",
|
||||
"@types/tinycolor2": "1.4.3",
|
||||
"@types/url-parse": "1.4.4",
|
||||
"@typescript-eslint/eslint-plugin": "5.1.0",
|
||||
"@typescript-eslint/parser": "5.1.0",
|
||||
"@typescript-eslint/eslint-plugin": "5.2.0",
|
||||
"@typescript-eslint/parser": "5.2.0",
|
||||
"babel-eslint": "10.1.0",
|
||||
"babel-jest": "27.3.1",
|
||||
"babel-loader": "8.2.2",
|
||||
"babel-loader": "8.2.3",
|
||||
"babel-plugin-module-resolver": "4.1.0",
|
||||
"babel-plugin-transform-remove-console": "6.9.4",
|
||||
"deep-freeze": "0.0.1",
|
||||
"detox": "18.22.2",
|
||||
"detox": "18.23.1",
|
||||
"eslint": "7.32.0",
|
||||
"eslint-plugin-header": "3.1.1",
|
||||
"eslint-plugin-import": "2.25.2",
|
||||
|
|
@ -132,7 +132,7 @@
|
|||
"eslint-plugin-mattermost": "github:mattermost/eslint-plugin-mattermost#46ad99355644a719bf32082f472048f526605181",
|
||||
"eslint-plugin-react": "7.26.1",
|
||||
"eslint-plugin-react-hooks": "4.2.0",
|
||||
"husky": "7.0.2",
|
||||
"husky": "7.0.4",
|
||||
"isomorphic-fetch": "3.0.0",
|
||||
"jest": "27.3.1",
|
||||
"jest-cli": "27.3.1",
|
||||
|
|
@ -140,7 +140,7 @@
|
|||
"metro-react-native-babel-preset": "0.66.2",
|
||||
"mmjstool": "github:mattermost/mattermost-utilities#519b99a4e51e6c67a0dbd46a6efdff27dc835aaa",
|
||||
"mock-async-storage": "2.2.0",
|
||||
"nock": "13.1.3",
|
||||
"nock": "13.1.4",
|
||||
"patch-package": "6.4.7",
|
||||
"react-native-dev-menu": "4.0.2",
|
||||
"react-native-dotenv": "3.2.0",
|
||||
|
|
|
|||
|
|
@ -1,54 +0,0 @@
|
|||
diff --git a/node_modules/@nozbe/watermelondb/adapters/sqlite/index.d.ts b/node_modules/@nozbe/watermelondb/adapters/sqlite/index.d.ts
|
||||
index bb8f49a..1036aca 100644
|
||||
--- a/node_modules/@nozbe/watermelondb/adapters/sqlite/index.d.ts
|
||||
+++ b/node_modules/@nozbe/watermelondb/adapters/sqlite/index.d.ts
|
||||
@@ -23,6 +23,7 @@ declare module '@nozbe/watermelondb/adapters/sqlite' {
|
||||
export interface SQLiteAdapterOptions {
|
||||
dbName?: string
|
||||
migrations?: SchemaMigrations
|
||||
+ migrationEvents?: MigrationEvents,
|
||||
schema: AppSchema
|
||||
jsi?: boolean
|
||||
}
|
||||
diff --git a/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/Database.kt b/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/Database.kt
|
||||
index 802f137..785239e 100644
|
||||
--- a/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/Database.kt
|
||||
+++ b/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/Database.kt
|
||||
@@ -11,17 +11,35 @@ import java.io.File
|
||||
class Database(private val name: String, private val context: Context) {
|
||||
|
||||
private val db: SQLiteDatabase by lazy {
|
||||
- SQLiteDatabase.openOrCreateDatabase(
|
||||
+ SQLiteDatabase.openDatabase(
|
||||
// TODO: This SUCKS. Seems like Android doesn't like sqlite `?mode=memory&cache=shared` mode. To avoid random breakages, save the file to /tmp, but this is slow.
|
||||
// NOTE: This is because Android system SQLite is not compiled with SQLITE_USE_URI=1
|
||||
// issue `PRAGMA cache=shared` query after connection when needed
|
||||
if (name == ":memory:" || name.contains("mode=memory")) {
|
||||
context.cacheDir.delete()
|
||||
File(context.cacheDir, name).path
|
||||
+ } else if (name.contains("/") || name.contains("file")) {
|
||||
+ // Extracts the database name from the path
|
||||
+ val dbName = name.substringAfterLast("/")
|
||||
+
|
||||
+ // Extracts the real path where the *.db file will be created
|
||||
+ val truePath = name.substringAfterLast("file://").substringBeforeLast("/")
|
||||
+
|
||||
+ // Creates the directory
|
||||
+ if (!truePath.contains("databases")) {
|
||||
+ val fileObj = File(truePath, "databases")
|
||||
+ fileObj.mkdir()
|
||||
+
|
||||
+ File("${truePath}/databases", dbName).path
|
||||
+ } else {
|
||||
+ File(truePath, dbName).path
|
||||
+ }
|
||||
} else
|
||||
// On some systems there is some kind of lock on `/databases` folder ¯\_(ツ)_/¯
|
||||
context.getDatabasePath("$name.db").path.replace("/databases", ""),
|
||||
- null)
|
||||
+ null,
|
||||
+ SQLiteDatabase.CREATE_IF_NECESSARY or SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING,
|
||||
+ )
|
||||
}
|
||||
|
||||
var userVersion: Int
|
||||
26
patches/@nozbe+watermelondb+0.24.0.patch
Normal file
26
patches/@nozbe+watermelondb+0.24.0.patch
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
diff --git a/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/Database.kt b/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/Database.kt
|
||||
index ca31e20..b45c753 100644
|
||||
--- a/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/Database.kt
|
||||
+++ b/node_modules/@nozbe/watermelondb/native/android/src/main/java/com/nozbe/watermelondb/Database.kt
|
||||
@@ -22,6 +22,21 @@ class Database(
|
||||
if (name == ":memory:" || name.contains("mode=memory")) {
|
||||
context.cacheDir.delete()
|
||||
File(context.cacheDir, name).path
|
||||
+ } else if (name.contains("/") || name.contains("file")) {
|
||||
+ // Extracts the database name from the path
|
||||
+ val dbName = name.substringAfterLast("/")
|
||||
+
|
||||
+ // Extracts the real path where the *.db file will be created
|
||||
+ val truePath = name.substringAfterLast("file://").substringBeforeLast("/")
|
||||
+
|
||||
+ // Creates the directory
|
||||
+ if (!truePath.contains("databases")) {
|
||||
+ val fileObj = File(truePath, "databases")
|
||||
+ fileObj.mkdir()
|
||||
+ File("${truePath}/databases", dbName).path
|
||||
+ } else {
|
||||
+ File(truePath, dbName).path
|
||||
+ }
|
||||
} else {
|
||||
// On some systems there is some kind of lock on `/databases` folder ¯\_(ツ)_/¯
|
||||
context.getDatabasePath("$name.db").path.replace("/databases", "")
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
diff --git a/node_modules/react-native-haptic-feedback/android/src/main/java/com/mkuczera/RNReactNativeHapticFeedbackModule.java b/node_modules/react-native-haptic-feedback/android/src/main/java/com/mkuczera/RNReactNativeHapticFeedbackModule.java
|
||||
index cc597e0..db3c3f9 100644
|
||||
--- a/node_modules/react-native-haptic-feedback/android/src/main/java/com/mkuczera/RNReactNativeHapticFeedbackModule.java
|
||||
+++ b/node_modules/react-native-haptic-feedback/android/src/main/java/com/mkuczera/RNReactNativeHapticFeedbackModule.java
|
||||
@@ -39,7 +39,7 @@ public class RNReactNativeHapticFeedbackModule extends ReactContextBaseJavaModul
|
||||
|
||||
switch (type) {
|
||||
case "impactLight":
|
||||
- durations = new long[]{0, 20};
|
||||
+ durations = new long[]{0, 5};
|
||||
break;
|
||||
case "impactMedium":
|
||||
durations = new long[]{0, 40};
|
||||
13
patches/react-native-haptic-feedback+1.13.0.patch
Normal file
13
patches/react-native-haptic-feedback+1.13.0.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/node_modules/react-native-haptic-feedback/android/src/main/java/com/mkuczera/VibrateFactory/VibrateFactory.java b/node_modules/react-native-haptic-feedback/android/src/main/java/com/mkuczera/VibrateFactory/VibrateFactory.java
|
||||
index 167118f..e7b8fc4 100644
|
||||
--- a/node_modules/react-native-haptic-feedback/android/src/main/java/com/mkuczera/VibrateFactory/VibrateFactory.java
|
||||
+++ b/node_modules/react-native-haptic-feedback/android/src/main/java/com/mkuczera/VibrateFactory/VibrateFactory.java
|
||||
@@ -15,7 +15,7 @@ import com.mkuczera.VibrateWithCreatePredefined;
|
||||
public class VibrateFactory {
|
||||
static Map<String, Vibrate> vibrateMap = new HashMap<>();
|
||||
static {
|
||||
- vibrateMap.put("impactLight", new VibrateWithDuration(new long[]{0, 20}));
|
||||
+ vibrateMap.put("impactLight", new VibrateWithDuration(new long[]{0, 5}));
|
||||
vibrateMap.put("impactMedium", new VibrateWithDuration(new long[]{0, 40}));
|
||||
vibrateMap.put("impactHeavy", new VibrateWithDuration(new long[]{0, 60}));
|
||||
vibrateMap.put("notificationSuccess", new VibrateWithDuration(new long[]{0, 40 ,60, 20}));
|
||||
Loading…
Reference in a new issue