diff --git a/CHANGELOG.md b/CHANGELOG.md index ac4e850921..4494171320 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -[unreleased] +[2.0.3-alpha.12] * Better descriptions of the joining process diff --git a/packages/desktop/CHANGELOG.md b/packages/desktop/CHANGELOG.md index 2b3209af66..17f8ce2ebe 100644 --- a/packages/desktop/CHANGELOG.md +++ b/packages/desktop/CHANGELOG.md @@ -1,4 +1,25 @@ -[unreleased] +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [2.0.3-alpha.12](https://github.com/TryQuiet/quiet/compare/@quiet/desktop@2.0.3-alpha.11...@quiet/desktop@2.0.3-alpha.12) (2023-12-04) + +**Note:** Version bump only for package @quiet/desktop + + + + + +[2.0.3-alpha.12] + +* Better descriptions of the joining process + +* Update custom deps repositiries (upload-s3-action, ipfs-pubsub-peer-monitor) + +* Add certificates validation. + +* Move certificates to separate store. * Move csrs to separate store. diff --git a/packages/desktop/package-lock.json b/packages/desktop/package-lock.json index d623077d56..51ef9afece 100644 --- a/packages/desktop/package-lock.json +++ b/packages/desktop/package-lock.json @@ -1,12 +1,12 @@ { "name": "@quiet/desktop", - "version": "2.0.3-alpha.10", + "version": "2.0.3-alpha.12", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@quiet/desktop", - "version": "2.0.3-alpha.10", + "version": "2.0.3-alpha.12", "license": "ISC", "dependencies": { "@electron/remote": "^2.0.8", diff --git a/packages/desktop/package.json b/packages/desktop/package.json index 6d54258c66..307b04ec0b 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -80,7 +80,7 @@ }, "homepage": "https://github.com/TryQuiet", "@comment version": "To build new version for specific platform, just replace platform in version tag to one of following linux, mac, windows", - "version": "2.0.3-alpha.10", + "version": "2.0.3-alpha.12", "description": "Decentralized team chat", "main": "dist/main/main.js", "scripts": { diff --git a/packages/desktop/src/renderer/components/widgets/channels/BasicMessage.tsx b/packages/desktop/src/renderer/components/widgets/channels/BasicMessage.tsx index b4f7e19cdb..fe6ab39c28 100644 --- a/packages/desktop/src/renderer/components/widgets/channels/BasicMessage.tsx +++ b/packages/desktop/src/renderer/components/widgets/channels/BasicMessage.tsx @@ -174,20 +174,14 @@ export const BasicMessageComponent: React.FC = ({ const isUnregistered = type === UserLabelType.UNREGISTERED const handleOpen = isUnregistered ? unregisteredUsernameModalHandleOpen : duplicatedUsernameModalHandleOpen - console.log('Unregistered Debug - UserLabel Component', { isUnregistered }) - return ( ( diff --git a/packages/mobile/CHANGELOG.md b/packages/mobile/CHANGELOG.md index 2b3209af66..2611f086fa 100644 --- a/packages/mobile/CHANGELOG.md +++ b/packages/mobile/CHANGELOG.md @@ -1,4 +1,29 @@ -[unreleased] +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [2.0.3-alpha.13](https://github.com/TryQuiet/quiet/compare/@quiet/mobile@2.0.3-alpha.12...@quiet/mobile@2.0.3-alpha.13) (2023-12-04) + + +### Bug Fixes + +* correct getting ndk path ([#2130](https://github.com/TryQuiet/quiet/issues/2130)) ([f0a6336](https://github.com/TryQuiet/quiet/commit/f0a6336434d4f8ba829123ca6f24d3df3df557a8)) +* poin to a different directory after breaking changes ([#2132](https://github.com/TryQuiet/quiet/issues/2132)) ([07ef5bb](https://github.com/TryQuiet/quiet/commit/07ef5bb5a403ee52cf69982d19a9d0b14f11c969)) + + + + + +[2.0.3-alpha.12] + +* Better descriptions of the joining process + +* Update custom deps repositiries (upload-s3-action, ipfs-pubsub-peer-monitor) + +* Add certificates validation. + +* Move certificates to separate store. * Move csrs to separate store. diff --git a/packages/mobile/android/app/build.gradle b/packages/mobile/android/app/build.gradle index aa33b2bc6b..a6e711f39e 100644 --- a/packages/mobile/android/app/build.gradle +++ b/packages/mobile/android/app/build.gradle @@ -139,14 +139,28 @@ def reactNativeArchitectures() { return value ? value.split(",") : ["arm64-v8a"] } -Properties properties = new Properties() -def localPropertiesFile = project.rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - properties.load(localPropertiesFile.newDataInputStream()) +def getNDK() { + // Load local.properties + Properties properties = new Properties() + def localPropertiesFile = rootProject.file('local.properties') + if (localPropertiesFile.exists()) { + properties.load(localPropertiesFile.newDataInputStream()) + } + + // Return ndk.dir if it exists + def localNDK = properties['ndk.path'] + if (localNDK) { + return localNDK + } + + // If ndk.dir doesn't exist, check for NDK_PATH in gradle.properties + return rootProject.ext.has('NDK_PATH') ? rootProject.ext.get('NDK_PATH') : null } +def ndkDirectory = getNDK() + android { - ndkPath properties.getProperty('ndk.dir', project.property('NDK_PATH')) + ndkPath ndkDirectory ndkVersion rootProject.ext.ndkVersion @@ -172,8 +186,8 @@ android { applicationId "com.quietmobile" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 381 - versionName "2.0.3-alpha.11" + versionCode 383 + versionName "2.0.3-alpha.13" resValue "string", "build_config_package", "com.quietmobile" testBuildType System.getProperty('testBuildType', 'debug') testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' diff --git a/packages/mobile/ios/Quiet/Info.plist b/packages/mobile/ios/Quiet/Info.plist index 7844106f33..dcd12a1770 100644 --- a/packages/mobile/ios/Quiet/Info.plist +++ b/packages/mobile/ios/Quiet/Info.plist @@ -34,7 +34,7 @@ CFBundleVersion - 338 + 340 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/packages/mobile/ios/QuietTests/Info.plist b/packages/mobile/ios/QuietTests/Info.plist index 50d2cac43e..68bfa29706 100644 --- a/packages/mobile/ios/QuietTests/Info.plist +++ b/packages/mobile/ios/QuietTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 338 + 340 diff --git a/packages/mobile/package-lock.json b/packages/mobile/package-lock.json index fc190a66f1..9741209c5d 100644 --- a/packages/mobile/package-lock.json +++ b/packages/mobile/package-lock.json @@ -1,12 +1,12 @@ { "name": "@quiet/mobile", - "version": "2.0.3-alpha.11", + "version": "2.0.3-alpha.13", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@quiet/mobile", - "version": "2.0.3-alpha.11", + "version": "2.0.3-alpha.13", "dependencies": { "@peculiar/webcrypto": "^1.4.3", "@react-native-clipboard/clipboard": "^1.11.2", diff --git a/packages/mobile/package.json b/packages/mobile/package.json index f7a4d44204..899861df30 100644 --- a/packages/mobile/package.json +++ b/packages/mobile/package.json @@ -1,6 +1,6 @@ { "name": "@quiet/mobile", - "version": "2.0.3-alpha.11", + "version": "2.0.3-alpha.13", "scripts": { "build": "tsc -p tsconfig.build.json --noEmit", "storybook-android": "ENVFILE=.env.storybook react-native run-android --variant=storybookDebug --appIdSuffix=storybook.debug", diff --git a/packages/mobile/src/setupTests.tsx b/packages/mobile/src/setupTests.tsx index ccdc73625a..d9140abf96 100644 --- a/packages/mobile/src/setupTests.tsx +++ b/packages/mobile/src/setupTests.tsx @@ -37,6 +37,18 @@ jest.mock('redux-persist', () => { jest.mock('react-native/Libraries/EventEmitter/NativeEventEmitter') +jest.mock('redux-persist-filesystem-storage', () => ({ + config: jest.fn() +})) + +jest.mock('react-native-blob-util', () => ({ + fs: { + dirs: { + DocumentDir: 'dir' + } + } +})) + jest.mock('react-native-mathjax-html-to-svg', () => { }) jest.mock('react-native-qrcode-svg', () => jest.fn()) diff --git a/packages/mobile/src/store/navigation/redirection/redirection.saga.test.ts b/packages/mobile/src/store/navigation/redirection/redirection.saga.test.ts index 973be6336f..6d8dab20d0 100644 --- a/packages/mobile/src/store/navigation/redirection/redirection.saga.test.ts +++ b/packages/mobile/src/store/navigation/redirection/redirection.saga.test.ts @@ -3,7 +3,6 @@ import { expectSaga } from 'redux-saga-test-plan' import { FactoryGirl } from 'factory-girl' import { generateMessageFactoryContentWithId, getFactory, identity, publicChannels } from '@quiet/state-manager' import { setupCrypto } from '@quiet/identity' - import { navigationActions } from '../navigation.slice' import { ScreenNames } from '../../../const/ScreenNames.enum' diff --git a/packages/mobile/src/store/store.ts b/packages/mobile/src/store/store.ts index 35a0ea0dcc..12a2ea65c7 100644 --- a/packages/mobile/src/store/store.ts +++ b/packages/mobile/src/store/store.ts @@ -1,4 +1,5 @@ import FilesystemStorage from 'redux-persist-filesystem-storage' +import RNFetchBlob from 'react-native-blob-util' import { configureStore, getDefaultMiddleware } from '@reduxjs/toolkit' import { persistReducer, persistStore } from 'redux-persist' import createSagaMiddleware from 'redux-saga' @@ -16,9 +17,17 @@ import { ConnectionTransform, UsersTransform, } from '@quiet/state-manager' + import { StoreKeys } from './store.keys' import { InitTransform } from './init/init.transform' +FilesystemStorage.config({ + storagePath: `${RNFetchBlob.fs.dirs.DocumentDir}/persistStore2`, + encoding: "utf8", + toFileName: (name: string) => name.split(":").join("-"), + fromFileName: (name: string) => name.split("-").join(":"), +}); + const persistedReducer = persistReducer( { key: 'persistedReducer', diff --git a/packages/state-manager/src/sagas/communities/communities.selectors.ts b/packages/state-manager/src/sagas/communities/communities.selectors.ts index f0e7113803..93ec769fc3 100644 --- a/packages/state-manager/src/sagas/communities/communities.selectors.ts +++ b/packages/state-manager/src/sagas/communities/communities.selectors.ts @@ -83,7 +83,7 @@ export const ownerNickname = createSelector( const parsedCert = parseCertificate(certificate) nickname = getCertFieldValue(parsedCert, CertFieldsTypes.nickName) } else { - nickname = getCertFieldValue(oldestParsedCerificate, CertFieldsTypes.nickName) + nickname = getCertFieldValue(oldestParsedCerificate.certificate, CertFieldsTypes.nickName) } if (!nickname) { diff --git a/packages/state-manager/src/sagas/users/users.selectors.ts b/packages/state-manager/src/sagas/users/users.selectors.ts index 6971cb57e2..e86d032e26 100644 --- a/packages/state-manager/src/sagas/users/users.selectors.ts +++ b/packages/state-manager/src/sagas/users/users.selectors.ts @@ -89,7 +89,6 @@ export const allUsers = createSelector(csrsMapping, certificatesMapping, (csrs, isDuplicated: false, pubKey, } - console.log('Unregistered Debug - allUsers selector - certs - user', users[pubKey]) }) Object.keys(csrs).map(pubKey => { @@ -105,16 +104,12 @@ export const allUsers = createSelector(csrsMapping, certificatesMapping, (csrs, const isRegistered = Boolean(certs[pubKey]) - console.log('Unregistered Debug - allUsers selector - csrs - certs[pubKey]', certs[pubKey]) - users[pubKey] = { ...csrs[pubKey], isRegistered, isDuplicated, pubKey, } - - console.log('Unregistered Debug - allUsers selector - csrs - user', users[pubKey]) }) return users @@ -124,26 +119,31 @@ export const getUserByPubKey = (pubKey: string) => createSelector(allUsers, user export const getOldestParsedCerificate = createSelector(certificates, certs => { const getTimestamp = (cert: Certificate) => new Date(cert.notBefore.value).getTime() - let certificates: Certificate[] = [] - Object.keys(certs).map(pubKey => { - certificates = [...certificates, certs[pubKey]] - }) - certificates.sort((a, b) => { - const aTimestamp = getTimestamp(a) - const bTimestamp = getTimestamp(b) - return aTimestamp - bTimestamp - }) + let certificates: { pubkey: string; certificate: Certificate }[] = [] + + certificates = Array.from(Object.entries(certs)) + .sort((a, b) => { + const aTimestamp = getTimestamp(a[1]) + const bTimestamp = getTimestamp(b[1]) + return aTimestamp - bTimestamp + }) + .map(cert => { + return { + pubkey: cert[0], + certificate: cert[1], + } + }) return certificates[0] }) export const ownerData = createSelector(getOldestParsedCerificate, ownerCert => { if (!ownerCert) return null - const username = getCertFieldValue(ownerCert, CertFieldsTypes.nickName) - const onionAddress = getCertFieldValue(ownerCert, CertFieldsTypes.commonName) - const peerId = getCertFieldValue(ownerCert, CertFieldsTypes.peerId) - const dmPublicKey = getCertFieldValue(ownerCert, CertFieldsTypes.dmPublicKey) - const pubKey = keyFromCertificate(ownerCert) + const username = getCertFieldValue(ownerCert.certificate, CertFieldsTypes.nickName) + const onionAddress = getCertFieldValue(ownerCert.certificate, CertFieldsTypes.commonName) + const peerId = getCertFieldValue(ownerCert.certificate, CertFieldsTypes.peerId) + const dmPublicKey = getCertFieldValue(ownerCert.certificate, CertFieldsTypes.dmPublicKey) + const pubKey = ownerCert.pubkey return { username,