author
int64
658
755k
date
stringlengths
19
19
timezone
int64
-46,800
43.2k
hash
stringlengths
40
40
message
stringlengths
5
490
mods
list
language
stringclasses
20 values
license
stringclasses
3 values
repo
stringlengths
5
68
original_message
stringlengths
12
491
129,200
24.06.2022 09:21:56
14,400
fe72ec70f739b77c8aecccd2efefd74a6f87af7f
[services][identity] helper function to finish PAKE login Summary: helper function completes PAKE login and returns an access token or an error depending on the outcome depends on D4350 Test Plan: tested with method that calls this helper Reviewers: palys-swm, jimpo, karol-bisztyga Subscribers: ashoat, Adrian, atul, yayabosh
[ { "change_type": "MODIFY", "old_path": "services/identity/src/service.rs", "new_path": "services/identity/src/service.rs", "diff": "@@ -44,6 +44,7 @@ mod proto {\ntonic::include_proto!(\"identity\");\n}\n+#[derive(Debug)]\nenum PakeWorkflow {\nRegistration,\nLogin,\n@@ -360,3 +361,56 @@ async fn pake_login_start(\n}\n}\n}\n+\n+async fn pake_login_finish(\n+ user_id: &str,\n+ device_id: &str,\n+ client: DatabaseClient,\n+ server_login: Option<ServerLogin<Cipher>>,\n+ pake_credential_finalization: &[u8],\n+ rng: &mut (impl Rng + CryptoRng),\n+ num_messages_received: u8,\n+ pake_workflow: PakeWorkflow,\n+) -> Result<PakeLoginResponseStruct, Status> {\n+ if (num_messages_received != 1\n+ && matches!(pake_workflow, PakeWorkflow::Login))\n+ || (num_messages_received != 2\n+ && matches!(pake_workflow, PakeWorkflow::Registration))\n+ {\n+ error!(\"Too many messages received in stream, aborting\");\n+ return Err(Status::aborted(\"please retry\"));\n+ }\n+ if user_id.is_empty() || device_id.is_empty() {\n+ error!(\n+ \"Incomplete data: user ID {}, device ID {}\",\n+ user_id, device_id\n+ );\n+ return Err(Status::aborted(\"user not found\"));\n+ }\n+ match server_login\n+ .ok_or_else(|| {\n+ error!(\"Server login missing in {:?} PAKE workflow\", pake_workflow);\n+ Status::aborted(\"login failed\")\n+ })?\n+ .finish(\n+ CredentialFinalization::deserialize(pake_credential_finalization)\n+ .map_err(|e| {\n+ error!(\"Failed to deserialize credential finalization bytes: {}\", e);\n+ Status::aborted(\"login failed\")\n+ })?,\n+ ) {\n+ Ok(_) => Ok(PakeLoginResponseStruct {\n+ data: Some(AccessToken(\n+ put_token_helper(client, AuthType::Password, user_id, device_id, rng)\n+ .await?,\n+ )),\n+ }),\n+ Err(e) => {\n+ error!(\n+ \"Encountered a PAKE protocol error when finishing login: {}\",\n+ e\n+ );\n+ Err(Status::aborted(\"server error\"))\n+ }\n+ }\n+}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services][identity] helper function to finish PAKE login Summary: helper function completes PAKE login and returns an access token or an error depending on the outcome depends on D4350 Test Plan: tested with method that calls this helper Reviewers: palys-swm, jimpo, karol-bisztyga Reviewed By: palys-swm Subscribers: ashoat, Adrian, atul, yayabosh Differential Revision: https://phab.comm.dev/D4351
129,184
28.06.2022 22:28:40
25,200
7cac0c47e3521f8c8ad424d1cccef57b25a98e46
[native] `codeVersion` -> 136
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -434,8 +434,8 @@ android {\napplicationId 'app.comm.android'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 135\n- versionName '1.0.135'\n+ versionCode 136\n+ versionName '1.0.136'\nmissingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "new_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "diff": "@@ -13,7 +13,7 @@ namespace comm {\nnamespace jsi = facebook::jsi;\nclass CommCoreModule : public facebook::react::CommCoreModuleSchemaCxxSpecJSI {\n- const int codeVersion{135};\n+ const int codeVersion{136};\nstd::unique_ptr<WorkerThread> databaseThread;\nstd::unique_ptr<WorkerThread> cryptoThread;\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.debug.plist", "new_path": "native/ios/Comm/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.135</string>\n+ <string>1.0.136</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>135</string>\n+ <string>136</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.release.plist", "new_path": "native/ios/Comm/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.135</string>\n+ <string>1.0.136</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>135</string>\n+ <string>136</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] `codeVersion` -> 136
129,200
28.06.2022 14:17:54
14,400
3cecc94df5c13c99226e9dd20b2a87f036141cea
[services] refactor some if let statements to reduce nesting Summary: pretty straightforward refactor. resolves : Refactor `if let` error handling](https://linear.app/comm/issue/ENG-1305/refactor-if-let-error-handling) Test Plan: cargo build Reviewers: palys-swm, karol-bisztyga, jimpo Subscribers: ashoat, Adrian, atul, yayabosh
[ { "change_type": "MODIFY", "old_path": "services/identity/src/service.rs", "new_path": "services/identity/src/service.rs", "diff": "@@ -94,26 +94,19 @@ impl IdentityService for MyIdentityService {\npake_registration_request_and_user_id,\n)),\n}) => {\n- if let Err(e) = tx\n- .send(\n- pake_registration_start(\n+ let registration_start_result = pake_registration_start(\nconfig.clone(),\n&mut OsRng,\n- &pake_registration_request_and_user_id\n- .pake_registration_request,\n+ &pake_registration_request_and_user_id.pake_registration_request,\nnum_messages_received,\n)\n.await\n- .map(\n- |registration_response_and_server_registration| {\n+ .map(|registration_response_and_server_registration| {\nserver_registration =\nSome(registration_response_and_server_registration.1);\nregistration_response_and_server_registration.0\n- },\n- ),\n- )\n- .await\n- {\n+ });\n+ if let Err(e) = tx.send(registration_start_result).await {\nerror!(\"Response was dropped: {}\", e);\nbreak;\n}\n@@ -126,8 +119,7 @@ impl IdentityService for MyIdentityService {\npake_registration_upload_and_credential_request,\n)),\n}) => {\n- if let Err(e) = tx\n- .send(\n+ let registration_finish_and_login_start_result =\nmatch pake_registration_finish(\n&user_id,\nclient.clone(),\n@@ -148,21 +140,18 @@ impl IdentityService for MyIdentityService {\nPakeWorkflow::Registration,\n)\n.await\n- .map(\n- |pake_login_response_and_server_login| {\n- server_login =\n- Some(pake_login_response_and_server_login.1);\n+ .map(|pake_login_response_and_server_login| {\n+ server_login = Some(pake_login_response_and_server_login.1);\nRegistrationResponse {\ndata: Some(PakeRegistrationLoginResponse(\npake_login_response_and_server_login.0,\n)),\n}\n- },\n- ),\n+ }),\nErr(e) => Err(e),\n- },\n- )\n- .await\n+ };\n+ if let Err(e) =\n+ tx.send(registration_finish_and_login_start_result).await\n{\nerror!(\"Response was dropped: {}\", e);\nbreak;\n@@ -175,9 +164,7 @@ impl IdentityService for MyIdentityService {\npake_credential_finalization,\n)),\n}) => {\n- if let Err(e) = tx\n- .send(\n- pake_login_finish(\n+ let login_finish_result = pake_login_finish(\n&user_id,\n&device_id,\nclient,\n@@ -188,16 +175,10 @@ impl IdentityService for MyIdentityService {\nPakeWorkflow::Registration,\n)\n.await\n- .map(|pake_login_response| {\n- RegistrationResponse {\n- data: Some(PakeRegistrationLoginResponse(\n- pake_login_response,\n- )),\n- }\n- }),\n- )\n- .await\n- {\n+ .map(|pake_login_response| RegistrationResponse {\n+ data: Some(PakeRegistrationLoginResponse(pake_login_response)),\n+ });\n+ if let Err(e) = tx.send(login_finish_result).await {\nerror!(\"Response was dropped: {}\", e);\n}\nbreak;\n@@ -242,18 +223,14 @@ impl IdentityService for MyIdentityService {\nOk(LoginRequest {\ndata: Some(WalletLoginRequest(req)),\n}) => {\n- if let Err(e) = tx\n- .send(\n- wallet_login_helper(\n+ let wallet_login_result = wallet_login_helper(\nclient,\nreq,\n&mut OsRng,\nnum_messages_received,\n)\n- .await,\n- )\n- .await\n- {\n+ .await;\n+ if let Err(e) = tx.send(wallet_login_result).await {\nerror!(\"Response was dropped: {}\", e);\n}\nbreak;\n@@ -267,9 +244,7 @@ impl IdentityService for MyIdentityService {\n)),\n})),\n}) => {\n- if let Err(e) = tx\n- .send(\n- pake_login_start(\n+ let login_start_result = pake_login_start(\nconfig.clone(),\nclient.clone(),\n&pake_credential_request_and_user_id.user_id,\n@@ -285,10 +260,8 @@ impl IdentityService for MyIdentityService {\npake_login_response_and_server_login.0,\n)),\n}\n- }),\n- )\n- .await\n- {\n+ });\n+ if let Err(e) = tx.send(login_start_result).await {\nerror!(\"Response was dropped: {}\", e);\nbreak;\n}\n@@ -302,9 +275,7 @@ impl IdentityService for MyIdentityService {\nSome(PakeCredentialFinalization(pake_credential_finalization)),\n})),\n}) => {\n- if let Err(e) = tx\n- .send(\n- pake_login_finish(\n+ let login_finish_result = pake_login_finish(\n&user_id,\n&device_id,\nclient,\n@@ -317,10 +288,8 @@ impl IdentityService for MyIdentityService {\n.await\n.map(|pake_login_response| LoginResponse {\ndata: Some(PakeLoginResponse(pake_login_response)),\n- }),\n- )\n- .await\n- {\n+ });\n+ if let Err(e) = tx.send(login_finish_result).await {\nerror!(\"Response was dropped: {}\", e);\n}\nbreak;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] refactor some if let statements to reduce nesting Summary: pretty straightforward refactor. resolves [ENG-1305 : Refactor `if let` error handling](https://linear.app/comm/issue/ENG-1305/refactor-if-let-error-handling) Test Plan: cargo build Reviewers: palys-swm, karol-bisztyga, jimpo Reviewed By: palys-swm Subscribers: ashoat, Adrian, atul, yayabosh Differential Revision: https://phab.comm.dev/D4386
129,184
27.06.2022 17:18:17
25,200
3ceabb267af8317c7b289779d461f2fb97c806cd
[services] Remove `build-[blob/backup]-base` from `services/package.json` Summary: We no longer have a base image for blob/backup base. These commands are no longer relevant. Test Plan: NA, searched codebase Reviewers: def-au1t, palys-swm, yayabosh, karol-bisztyga Subscribers: ashoat, Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "services/package.json", "new_path": "services/package.json", "diff": "\"test-tunnelbroker-service\": \"./scripts/test_service.sh tunnelbroker\",\n\"run-tunnelbroker-service-dev-mode\": \"COMM_SERVICES_DEV_MODE=1 ./scripts/run_server_image.sh tunnelbroker\",\n\"test-tunnelbroker-service-dev-mode\": \"COMM_SERVICES_DEV_MODE=1 ./scripts/test_service.sh tunnelbroker\",\n- \"build-backup-base\": \"./scripts/build_base_image.sh && docker-compose build backup-base\",\n\"run-backup-service\": \"./scripts/run_server_image.sh backup\",\n\"test-backup-service\": \"./scripts/test_service.sh backup\",\n\"run-backup-service-dev-mode\": \"COMM_SERVICES_DEV_MODE=1 ./scripts/run_server_image.sh backup\",\n\"test-backup-service-dev-mode\": \"COMM_SERVICES_DEV_MODE=1 ./scripts/test_service.sh backup\",\n- \"build-blob-base\": \"./scripts/build_base_image.sh && docker-compose build blob-base\",\n\"run-blob-service\": \"./scripts/run_server_image.sh blob\",\n\"test-blob-service\": \"./scripts/test_service.sh blob\",\n\"run-blob-service-dev-mode\": \"COMM_SERVICES_DEV_MODE=1 ./scripts/run_server_image.sh blob\",\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Remove `build-[blob/backup]-base` from `services/package.json` Summary: We no longer have a base image for blob/backup base. These commands are no longer relevant. Test Plan: NA, searched codebase Reviewers: def-au1t, palys-swm, yayabosh, karol-bisztyga Reviewed By: palys-swm, yayabosh, karol-bisztyga Subscribers: ashoat, Adrian, karol-bisztyga Differential Revision: https://phab.comm.dev/D4371
129,203
29.06.2022 10:23:34
14,400
aabc6d1d8ca35bf82162ea06827864e28eeaf85d
[keyserver] Delete `backup-phabricator.sh` Summary: Deletes `backup-phabricator.sh`, per comment on Linear [[ | here ]]. Test Plan: I no longer see the file Reviewers: ashoat, atul Subscribers: palys-swm, Adrian, ashoat
[ { "change_type": "DELETE", "old_path": "keyserver/bash/backup-phabricator.sh", "new_path": null, "diff": "-#!/usr/bin/env bash\n-\n-# run as: ssh user on root wheel\n-# run from: wherever\n-\n-# The path to Phabricator on our server\n-PHABRICATOR_PATH=/var/www/phacility/phabricator\n-\n-# The path to the backup directory on our server\n-BACKUP_PATH=/mnt/backup\n-\n-# The user that will be owning the backup files\n-BACKUP_USER=comm\n-\n-# The maximum amount of space to spend on Phabricator backups\n-MAX_DISK_USAGE_KB=204800 # 200 MiB\n-\n-set -e\n-[[ `whoami` = root ]] || exec sudo su -c \"$0\"\n-\n-cd \"$PHABRICATOR_PATH\"\n-\n-OUTPUT_FILE=\"$BACKUP_PATH/phabricator.$(date +'%Y-%m-%d-%R').sql.gz\"\n-\n-function remove_oldest_backup {\n- OLDEST_BACKUP=$(find \"$BACKUP_PATH\" -maxdepth 1 -name 'phabricator.*.sql.gz' -type f -printf '%T+ %p\\0' | sort -z | head -z -n 1 | cut -d ' ' -f2- | cut -d '' -f1)\n- if [[ ! \"$OLDEST_BACKUP\" ]]; then\n- return 1\n- fi\n- rm -f \"$OLDEST_BACKUP\"\n- return 0\n-}\n-\n-RETRIES=2\n-while [[ $RETRIES -ge 0 ]]; do\n- if ./bin/storage dump --compress --overwrite --output \"$OUTPUT_FILE\" > /dev/null 2>&1; then\n- break\n- fi\n- rm -f \"$OUTPUT_FILE\"\n-\n- remove_oldest_backup || break\n- ((RETRIES--))\n-done\n-\n-chown $BACKUP_USER:$(id -gn $BACKUP_USER) \"$OUTPUT_FILE\" || true\n-\n-while true; do\n- TOTAL_USAGE=$(sudo du -cs \"$BACKUP_PATH\"/phabricator.*.sql.gz | grep total | awk '{ print $1 }')\n- if [[ $TOTAL_USAGE -le $MAX_DISK_USAGE_KB ]]; then\n- break\n- fi\n- BACKUP_COUNT=$(ls -hla \"$BACKUP_PATH\"/phabricator.*.sql.gz | wc -l)\n- if [[ $BACKUP_COUNT -lt 2 ]]; then\n- break\n- fi\n- remove_oldest_backup || break\n-done\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[keyserver] Delete `backup-phabricator.sh` Summary: Deletes `backup-phabricator.sh`, per @ashoat's comment on Linear [[ https://linear.app/comm/issue/ENG-1295#comment-6c323c7f | here ]]. Test Plan: I no longer see the file Reviewers: ashoat, atul Reviewed By: ashoat, atul Subscribers: palys-swm, Adrian, ashoat Differential Revision: https://phab.comm.dev/D4397
129,203
29.06.2022 11:08:00
14,400
69b13a14348dbdf7d68129a168ad366fb204bf2e
[services] Clean up `run_server_image.sh` Summary: Cleaned up `run_server_image.sh` with style fixes and some double quoting to safely prevent globbing and word splitting. More details in inline comments. Test Plan: [[ | ShellCheck ]], close reading. Reviewers: ashoat, karol-bisztyga, atul Subscribers: palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "services/scripts/run_server_image.sh", "new_path": "services/scripts/run_server_image.sh", "diff": "set -e\nif [ \"$#\" -lt 1 ] || [ \"$#\" -gt 2 ]; then\n- echo \"Illegal number of parameters, expected:\"\n+ echo \"Illegal number of arguments, expected 2:\"\necho \"- one argument with a name of the service, currently available services:\"\n./scripts/list_services.sh\necho \"- one optional argument with port\"\n@@ -13,15 +13,15 @@ fi\nSERVICE=$1\nif [ \"$SERVICE\" == \"tunnelbroker\" ]; then\n- if [ ! -z \"$2\" ]; then\n+ if [ -n \"$2\" ]; then\nexport COMM_SERVICES_PORT_TUNNELBROKER=$2\nfi\nelif [ \"$SERVICE\" == \"backup\" ]; then\n- if [ ! -z \"$2\" ]; then\n+ if [ -n \"$2\" ]; then\nexport COMM_SERVICES_PORT_BACKUP=$2\nfi\nelif [ \"$SERVICE\" == \"blob\" ]; then\n- if [ ! -z \"$2\" ]; then\n+ if [ -n \"$2\" ]; then\nexport COMM_SERVICES_PORT_BLOB=$2\nfi\nelse\n@@ -29,5 +29,5 @@ else\nexit 1\nfi\n-docker-compose build $SERVICE-server\n-docker-compose up $SERVICE-server\n+docker-compose build \"$SERVICE\"-server\n+docker-compose up \"$SERVICE\"-server\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Clean up `run_server_image.sh` Summary: Cleaned up `run_server_image.sh` with style fixes and some double quoting to safely prevent globbing and word splitting. More details in inline comments. Test Plan: [[ https://www.shellcheck.net/ | ShellCheck ]], close reading. Reviewers: ashoat, karol-bisztyga, atul Reviewed By: ashoat Subscribers: palys-swm, Adrian Differential Revision: https://phab.comm.dev/D4398
129,203
29.06.2022 16:36:00
14,400
c8c20687c78e99f4f46b3d9657f2024390bbf446
[services] Use `[[ ]]` instead of `[ ]` in `run_server_image.sh` Had a git issue, this addresses
[ { "change_type": "MODIFY", "old_path": "services/scripts/run_server_image.sh", "new_path": "services/scripts/run_server_image.sh", "diff": "set -e\n-if [ \"$#\" -lt 1 ] || [ \"$#\" -gt 2 ]; then\n+if [[ \"$#\" -lt 1 ]] || [[ \"$#\" -gt 2 ]]; then\necho \"Illegal number of arguments, expected 2:\"\necho \"- one argument with a name of the service, currently available services:\"\n./scripts/list_services.sh\n@@ -12,16 +12,16 @@ if [ \"$#\" -lt 1 ] || [ \"$#\" -gt 2 ]; then\nfi\nSERVICE=$1\n-if [ \"$SERVICE\" == \"tunnelbroker\" ]; then\n- if [ -n \"$2\" ]; then\n+if [[ \"$SERVICE\" == \"tunnelbroker\" ]]; then\n+ if [[ -n \"$2\" ]]; then\nexport COMM_SERVICES_PORT_TUNNELBROKER=$2\nfi\n-elif [ \"$SERVICE\" == \"backup\" ]; then\n- if [ -n \"$2\" ]; then\n+elif [[ \"$SERVICE\" == \"backup\" ]]; then\n+ if [[ -n \"$2\" ]]; then\nexport COMM_SERVICES_PORT_BACKUP=$2\nfi\n-elif [ \"$SERVICE\" == \"blob\" ]; then\n- if [ -n \"$2\" ]; then\n+elif [[ \"$SERVICE\" == \"blob\" ]]; then\n+ if [[ -n \"$2\" ]]; then\nexport COMM_SERVICES_PORT_BLOB=$2\nfi\nelse\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Use `[[ ]]` instead of `[ ]` in `run_server_image.sh` Had a git issue, this addresses https://phab.comm.dev/D4398?vs=on&id=13979#124507.
129,184
29.06.2022 11:46:53
25,200
eb3734aa442fd7dd455b67f675ffe9b47403559b
[CI] Update `eslint_flow_jest` pipeline to enable autoscaling Summary: Run this workflow within `node:16.13-bullseye` container to enable autoscaling. Test Plan: Buildkite CI Reviewers: def-au1t, palys-swm, yayabosh Subscribers: ashoat, Adrian
[ { "change_type": "MODIFY", "old_path": ".buildkite/eslint_flow_jest.yml", "new_path": ".buildkite/eslint_flow_jest.yml", "diff": "@@ -4,5 +4,10 @@ steps:\n- 'yarn cleaninstall --frozen-lockfile --skip-optional'\n- 'yarn eslint --max-warnings=0 & yarn workspace lib flow & yarn workspace web flow & yarn workspace landing flow & yarn workspace native flow & yarn workspace keyserver flow'\n- 'yarn workspace lib test && yarn workspace keyserver test'\n+ plugins:\n+ - docker#v3.13.0:\n+ image: 'node:16.13-bullseye'\n+ always-pull: true\n+ workdir: /comm\nagents:\n- - 'linux=true'\n+ - 'autoscaling=true'\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[CI] Update `eslint_flow_jest` pipeline to enable autoscaling Summary: Run this workflow within `node:16.13-bullseye` container to enable autoscaling. Test Plan: Buildkite CI Reviewers: def-au1t, palys-swm, yayabosh Reviewed By: palys-swm Subscribers: ashoat, Adrian Differential Revision: https://phab.comm.dev/D4402
129,184
29.06.2022 14:24:35
25,200
4eb65acee8da19d21f288420c9fe745ae11331df
[CI] Update `android` pipeline to enable autoscaling Summary: Run this workflow within `reactnativecommunity/react-native-android:latest` to enable autoscaling. Test Plan: Buildkite CI Reviewers: def-au1t, palys-swm, yayabosh, geekbrother, ashoat Subscribers: ashoat, Adrian
[ { "change_type": "MODIFY", "old_path": ".buildkite/android.yml", "new_path": ".buildkite/android.yml", "diff": "@@ -3,5 +3,10 @@ steps:\n- 'yarn cleaninstall --frozen-lockfile --skip-optional'\n- 'cd native/android'\n- './gradlew bundleRelease --no-daemon \"-Dorg.gradle.jvmargs=-Xmx32g -XX:MaxPermSize=32g -XX:+HeapDumpOnOutOfMemoryError\"'\n+ plugins:\n+ - docker#v3.13.0:\n+ image: 'reactnativecommunity/react-native-android:latest'\n+ environment:\n+ - 'BUILDKITE=true'\nagents:\n- - 'android=true'\n+ - 'autoscaling=true'\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[CI] Update `android` pipeline to enable autoscaling Summary: Run this workflow within `reactnativecommunity/react-native-android:latest` to enable autoscaling. Test Plan: Buildkite CI Reviewers: def-au1t, palys-swm, yayabosh, geekbrother, ashoat Reviewed By: ashoat Subscribers: ashoat, Adrian Differential Revision: https://phab.comm.dev/D4406
129,184
29.06.2022 14:28:50
25,200
8eb4dabef91cc7bef079df4f4954596f336e9c2a
[CI] Deprecate `services` workflow on Buildkite/GH Actions Summary: We gave each service their own workflow to enable higher concurrency with autoscaling instances. As a result, the `services` workflow is now redundant/unnecessary and can be removed. Test Plan: NA Reviewers: def-au1t, palys-swm, yayabosh Subscribers: ashoat, Adrian, karol-bisztyga
[ { "change_type": "DELETE", "old_path": ".buildkite/services.yml", "new_path": null, "diff": "-steps:\n- - command:\n- - 'yarn cleaninstall --frozen-lockfile --skip-optional'\n- - 'cd services && yarn build-all'\n- agents:\n- - 'docker=true'\n" }, { "change_type": "DELETE", "old_path": ".github/workflows/services_ci.yml", "new_path": null, "diff": "-name: Services CI\n-\n-on:\n- push:\n- branches: [master]\n- paths-ignore:\n- - 'landing/**'\n- - 'web/**'\n- - 'docs/**'\n- - 'keyserver/**'\n-\n-jobs:\n- build:\n- runs-on: ubuntu-latest\n-\n- steps:\n- - uses: actions/checkout@v2\n-\n- - name: Install Yarn\n- run: npm install -g yarn\n-\n- - name: yarn --frozen-lockfile\n- run: yarn --frozen-lockfile\n-\n- - name: Build Services\n- working-directory: ./services\n- run: yarn build-all\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[CI] Deprecate `services` workflow on Buildkite/GH Actions Summary: We gave each service their own workflow to enable higher concurrency with autoscaling instances. As a result, the `services` workflow is now redundant/unnecessary and can be removed. Test Plan: NA Reviewers: def-au1t, palys-swm, yayabosh Reviewed By: palys-swm, yayabosh Subscribers: ashoat, Adrian, karol-bisztyga Differential Revision: https://phab.comm.dev/D4407
129,196
17.05.2022 16:16:29
-7,200
19b5044030075503fd840b3134ad54e9d4357b37
Implement JNI files to use MessageOperationUtilities in CommNotificationsHandler on Android Summary: Implement JNI files to use MessageOperationsUtilities functionality on Android in CommNotificationHandler.java Test Plan: No test plan. Child differential will use those changes and thus will provide opportunities for testing. Reviewers: palys-swm Subscribers: ashoat, Adrian, atul, yayabosh
[ { "change_type": "ADD", "old_path": null, "new_path": "native/android/app/src/cpp/MessageOperationsUtilitiesJNIHelper.cpp", "diff": "+#include \"MessageOperationsUtilitiesJNIHelper.h\"\n+#include \"MessageOperationsUtilities.h\"\n+#include \"SQLiteQueryExecutor.h\"\n+\n+namespace comm {\n+void MessageOperationsUtilitiesJNIHelper::storeMessageInfos(\n+ facebook::jni::alias_ref<MessageOperationsUtilitiesJNIHelper> jThis,\n+ facebook::jni::JString sqliteFilePath,\n+ facebook::jni::JString rawMessageInfosString) {\n+ std::string sqliteFilePathCpp = sqliteFilePath.toStdString();\n+ std::string rawMessageInfosStringCpp = rawMessageInfosString.toStdString();\n+ SQLiteQueryExecutor::initialize(sqliteFilePathCpp);\n+ MessageOperationsUtilities::storeMessageInfos(rawMessageInfosStringCpp);\n+}\n+\n+void MessageOperationsUtilitiesJNIHelper::registerNatives() {\n+ javaClassStatic()->registerNatives({\n+ makeNativeMethod(\n+ \"storeMessageInfos\",\n+ MessageOperationsUtilitiesJNIHelper::storeMessageInfos),\n+ });\n+}\n+} // namespace comm\n" }, { "change_type": "MODIFY", "old_path": "native/android/app/src/cpp/jsiInstaller.cpp", "new_path": "native/android/app/src/cpp/jsiInstaller.cpp", "diff": "#include \"CommCoreModule.h\"\n#include \"GlobalNetworkSingletonJNIHelper.h\"\n+#include \"MessageOperationsUtilitiesJNIHelper.h\"\n#include \"SQLiteQueryExecutor.h\"\n#include \"ThreadOperationsJNIHelper.h\"\n#include \"jniHelpers.h\"\n@@ -54,5 +55,6 @@ JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *) {\nCommHybrid::registerNatives();\ncomm::GlobalNetworkSingletonJNIHelper::registerNatives();\ncomm::ThreadOperationsJNIHelper::registerNatives();\n+ comm::MessageOperationsUtilitiesJNIHelper::registerNatives();\n});\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/android/app/src/main/java/app/comm/android/fbjni/MessageOperationsUtilities.java", "diff": "+package app.comm.android.fbjni;\n+\n+public class MessageOperationsUtilities {\n+ public static native void\n+ storeMessageInfos(String sqliteFilePath, String rawMessageInfosString);\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageOperationsUtilitiesJNIHelper.h", "diff": "+#pragma once\n+\n+#include <fbjni/fbjni.h>\n+\n+namespace comm {\n+class MessageOperationsUtilitiesJNIHelper\n+ : public facebook::jni::JavaClass<MessageOperationsUtilitiesJNIHelper> {\n+public:\n+ static auto constexpr kJavaDescriptor =\n+ \"Lapp/comm/android/fbjni/MessageOperationsUtilities;\";\n+\n+ static void storeMessageInfos(\n+ facebook::jni::alias_ref<MessageOperationsUtilitiesJNIHelper> jThis,\n+ facebook::jni::JString sqliteFilePath,\n+ facebook::jni::JString rawMessageInfosString);\n+ static void registerNatives();\n+};\n+} // namespace comm\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Implement JNI files to use MessageOperationUtilities in CommNotificationsHandler on Android Summary: Implement JNI files to use MessageOperationsUtilities functionality on Android in CommNotificationHandler.java Test Plan: No test plan. Child differential will use those changes and thus will provide opportunities for testing. Reviewers: palys-swm Reviewed By: palys-swm Subscribers: ashoat, Adrian, atul, yayabosh Differential Revision: https://phab.comm.dev/D4065
129,200
01.07.2022 17:47:11
14,400
981190b71bb26f6c7ab8015b3f2fa7ad34995422
[services] add new DB error types Summary: These new types will help us be more precise with our error handling Test Plan: cargo build Reviewers: palys-swm, jimpo, karol-bisztyga Subscribers: ashoat, Adrian, atul, yayabosh
[ { "change_type": "MODIFY", "old_path": "services/identity/src/database.rs", "new_path": "services/identity/src/database.rs", "diff": "use std::collections::HashMap;\n+use std::fmt::{Display, Formatter, Result as FmtResult};\nuse bytes::Bytes;\nuse chrono::{DateTime, ParseError, Utc};\n@@ -258,6 +259,45 @@ pub enum Error {\nInvalidAuthType,\n}\n+#[derive(Debug, derive_more::Error, derive_more::Constructor)]\n+pub struct DBItemError {\n+ attribute_name: &'static str,\n+ attribute_value: Option<AttributeValue>,\n+ attribute_error: DBItemAttributeError,\n+}\n+\n+impl Display for DBItemError {\n+ fn fmt(&self, f: &mut Formatter) -> FmtResult {\n+ match &self.attribute_error {\n+ DBItemAttributeError::Missing => {\n+ write!(f, \"Attribute {} is missing\", self.attribute_name)\n+ }\n+ DBItemAttributeError::IncorrectType => write!(\n+ f,\n+ \"Value for attribute {} has incorrect type: {:?}\",\n+ self.attribute_name, self.attribute_value\n+ ),\n+ error => write!(\n+ f,\n+ \"Error regarding attribute {} with value {:?}: {}\",\n+ self.attribute_name, self.attribute_value, error\n+ ),\n+ }\n+ }\n+}\n+\n+#[derive(Debug, derive_more::Display, derive_more::Error)]\n+pub enum DBItemAttributeError {\n+ #[display(...)]\n+ Missing,\n+ #[display(...)]\n+ IncorrectType,\n+ #[display(...)]\n+ InvalidTimestamp(chrono::ParseError),\n+ #[display(...)]\n+ Pake(ProtocolError),\n+}\n+\ntype AttributeName = String;\nfn create_simple_primary_key(\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] add new DB error types Summary: These new types will help us be more precise with our error handling Test Plan: cargo build Reviewers: palys-swm, jimpo, karol-bisztyga Reviewed By: palys-swm Subscribers: ashoat, Adrian, atul, yayabosh Differential Revision: https://phab.comm.dev/D4427
129,203
30.06.2022 17:00:25
14,400
1209c4709b296ee945853bc12ee9660ba7affc0a
[keyserver] Use `[[ ]]` instead of `[ ]` in `source-nvm.sh` Summary: Relevant Linear issue [[ | here ]]. Replaced `[ ]` with `[[ ]]` in `source-nvm.sh`. Depends on D4429 Test Plan: N/A Reviewers: ashoat, atul Subscribers: palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "keyserver/bash/source-nvm.sh", "new_path": "keyserver/bash/source-nvm.sh", "diff": "unset PREFIX\n# Nix controls the version of node within the development shell\n-[ -n \"$IN_NIX_SHELL\" ] && exit 0\n+[[ -n \"$IN_NIX_SHELL\" ]] && exit 0\n# Intel Mac\n-[ -s \"/usr/local/opt/nvm/nvm.sh\" ] && . \"/usr/local/opt/nvm/nvm.sh\"\n+[[ -s \"/usr/local/opt/nvm/nvm.sh\" ]] && . \"/usr/local/opt/nvm/nvm.sh\"\n# ARM-based Mac\n-[ -s \"/opt/homebrew/opt/nvm/nvm.sh\" ] && . \"/opt/homebrew/opt/nvm/nvm.sh\"\n+[[ -s \"/opt/homebrew/opt/nvm/nvm.sh\" ]] && . \"/opt/homebrew/opt/nvm/nvm.sh\"\n# Ubuntu\n-[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"\n+[[ -s \"$NVM_DIR/nvm.sh\" ]] && . \"$NVM_DIR/nvm.sh\"\nnvm install --no-progress\n" }, { "change_type": "MODIFY", "old_path": "keyserver/package.json", "new_path": "keyserver/package.json", "diff": "\"main\": \"dist/keyserver\",\n\"scripts\": {\n\"clean\": \"rm -rf dist/ && rm -rf node_modules/ && mkdir dist\",\n- \"babel-build\": \". bash/source-nvm.sh && yarn --silent babel src/ --out-dir dist/ --config-file ./babel.config.cjs --verbose --ignore 'src/landing/flow-typed','src/landing/node_modules','src/landing/package.json','src/lib/flow-typed','src/lib/node_modules','src/lib/package.json','src/web/flow-typed','src/web/node_modules','src/web/package.json','src/web/dist','src/web/webpack.config.js','src/web/account-bar.react.js','src/web/app.react.js','src/web/calendar','src/web/chat','src/web/flow','src/web/loading-indicator.react.js','src/web/modals','src/web/root.js','src/web/router-history.js','src/web/script.js','src/web/selectors/chat-selectors.js','src/web/selectors/entry-selectors.js','src/web/splash','src/web/vector-utils.js','src/web/vectors.react.js'\",\n+ \"babel-build\": \"./bash/source-nvm.sh && yarn --silent babel src/ --out-dir dist/ --config-file ./babel.config.cjs --verbose --ignore 'src/landing/flow-typed','src/landing/node_modules','src/landing/package.json','src/lib/flow-typed','src/lib/node_modules','src/lib/package.json','src/web/flow-typed','src/web/node_modules','src/web/package.json','src/web/dist','src/web/webpack.config.js','src/web/account-bar.react.js','src/web/app.react.js','src/web/calendar','src/web/chat','src/web/flow','src/web/loading-indicator.react.js','src/web/modals','src/web/root.js','src/web/router-history.js','src/web/script.js','src/web/selectors/chat-selectors.js','src/web/selectors/entry-selectors.js','src/web/splash','src/web/vector-utils.js','src/web/vectors.react.js'\",\n\"rsync\": \"rsync -rLpmuv --exclude '*/package.json' --exclude '*/node_modules/*' --include '*.json' --include '*.cjs' --exclude '*.*' src/ dist/\",\n\"prod-build\": \"yarn babel-build && yarn rsync && yarn update-geoip\",\n\"update-geoip\": \"yarn script dist/scripts/update-geoip.js\",\n\"prod\": \"node --trace-warnings --experimental-json-modules --loader=./loader.mjs --experimental-specifier-resolution=node dist/keyserver\",\n\"dev-rsync\": \"yarn --silent chokidar --initial --silent -s 'src/**/*.json' 'src/**/*.cjs' -c 'yarn rsync > /dev/null 2>&1'\",\n- \"dev\": \"yarn concurrently --names=\\\"BABEL,RSYNC,NODEM\\\" -c \\\"bgBlue.bold,bgMagenta.bold,bgGreen.bold\\\" \\\"yarn babel-build --watch\\\" \\\"yarn dev-rsync\\\" \\\". bash/source-nvm.sh && NODE_ENV=development nodemon -e js,json,cjs --watch dist --experimental-json-modules --loader=./loader.mjs --experimental-specifier-resolution=node dist/keyserver\\\"\",\n- \"script\": \". bash/source-nvm.sh && NODE_ENV=development node --experimental-json-modules --loader=./loader.mjs --experimental-specifier-resolution=node\",\n+ \"dev\": \"yarn concurrently --names=\\\"BABEL,RSYNC,NODEM\\\" -c \\\"bgBlue.bold,bgMagenta.bold,bgGreen.bold\\\" \\\"yarn babel-build --watch\\\" \\\"yarn dev-rsync\\\" \\\"./bash/source-nvm.sh && NODE_ENV=development nodemon -e js,json,cjs --watch dist --experimental-json-modules --loader=./loader.mjs --experimental-specifier-resolution=node dist/keyserver\\\"\",\n+ \"script\": \"./bash/source-nvm.sh && NODE_ENV=development node --experimental-json-modules --loader=./loader.mjs --experimental-specifier-resolution=node\",\n\"test\": \"jest\"\n},\n\"devDependencies\": {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[keyserver] Use `[[ ]]` instead of `[ ]` in `source-nvm.sh` Summary: Relevant Linear issue [[ https://linear.app/comm/issue/ENG-157/make-brackets-consistent-in-bash-scripts-in-services | here ]]. Replaced `[ ]` with `[[ ]]` in `source-nvm.sh`. Depends on D4429 Test Plan: N/A Reviewers: ashoat, atul Reviewed By: ashoat, atul Subscribers: palys-swm, Adrian Differential Revision: https://phab.comm.dev/D4422
129,203
05.07.2022 14:58:29
14,400
23c50285a0c1ab8fd3ad293293f119764e4c3023
[services] Clean up `run_all_services.sh` Summary: Relevant Linear issue [[ | here ]]. Added double quotes to prevent word-splitting or globbing in `run_all_services.sh`. Test Plan: [[ | ShellCheck ]], close reading. Reviewers: ashoat, atul, palys-swm Subscribers: Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "services/scripts/run_all_services.sh", "new_path": "services/scripts/run_all_services.sh", "diff": "set -e\n-SERVICES_LIST=`./scripts/list_services.sh`\n+SERVICES_LIST=$(./scripts/list_services.sh)\nSERVICES=\"\"\nfor SERVICE in $SERVICES_LIST; do\nSERVICES=\"$SERVICES $SERVICE-server\"\ndone\n-docker-compose up $SERVICES\n+docker-compose up \"$SERVICES\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Clean up `run_all_services.sh` Summary: Relevant Linear issue [[ https://linear.app/comm/issue/ENG-1295/clean-up-shell-scripts-in-codebase | here ]]. Added double quotes to prevent word-splitting or globbing in `run_all_services.sh`. Test Plan: [[ https://www.shellcheck.net/ | ShellCheck ]], close reading. Reviewers: ashoat, atul, palys-swm Reviewed By: ashoat Subscribers: Adrian, karol-bisztyga Differential Revision: https://phab.comm.dev/D4449
129,203
05.07.2022 15:07:17
14,400
78751dfb13340ea1409c72af1e83839b12a298a3
[services] Clean up `test_all_services.sh` Summary: Relevant Linear issue [[ | here ]]. Used `$(...)` syntax instead of legacy backticks `...` Test Plan: [[ | ShellCheck ]], close reading Reviewers: ashoat, atul, palys-swm Subscribers: Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "services/scripts/test_all_services.sh", "new_path": "services/scripts/test_all_services.sh", "diff": "set -e\n-SERVICES=`./scripts/list_services.sh`\n+SERVICES=$(./scripts/list_services.sh)\nfor SERVICE in $SERVICES; do\n- ./scripts/test_service.sh $SERVICE\n+ ./scripts/test_service.sh \"$SERVICE\"\ndone\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Clean up `test_all_services.sh` Summary: Relevant Linear issue [[ https://linear.app/comm/issue/ENG-1295/clean-up-shell-scripts-in-codebase | here ]]. Used `$(...)` syntax instead of legacy backticks `...` Test Plan: [[ https://www.shellcheck.net/ | ShellCheck ]], close reading Reviewers: ashoat, atul, palys-swm Reviewed By: ashoat Subscribers: Adrian, karol-bisztyga Differential Revision: https://phab.comm.dev/D4451
129,203
05.07.2022 15:01:38
14,400
6c4bb54796f1e69abd057b9b944d5116a7d8da80
[services] Clean up `test_service.sh` Summary: Relevant Linear issue [[ | here ]]. More details in inline comments below. Test Plan: [[ | ShellCheck ]], close reading. Reviewers: ashoat, atul, palys-swm Subscribers: Adrian, karol-bisztyga
[ { "change_type": "MODIFY", "old_path": "services/scripts/test_service.sh", "new_path": "services/scripts/test_service.sh", "diff": "set -e\n-SERVICES=`./scripts/list_services.sh`\n-SERVICE=`echo \"$SERVICES\" | grep $1` || echo \"No such service: $1\"\n+SERVICES=$(./scripts/list_services.sh)\n+SERVICE=$(grep \"$1\" <<< echo \"$SERVICES\") || echo \"No such service: $1\"\nif [ \"$SERVICE\" != \"$1\" ]; then\necho \"Expected one of these:\"\n@@ -15,5 +15,5 @@ export COMM_TEST_SERVICES=1\necho \"${SERVICE} service will be tested\"\n-docker-compose build ${SERVICE}-server\n-docker-compose run ${SERVICE}-server\n+docker-compose build \"${SERVICE}\"-server\n+docker-compose run \"${SERVICE}\"-server\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Clean up `test_service.sh` Summary: Relevant Linear issue [[ https://linear.app/comm/issue/ENG-1295/clean-up-shell-scripts-in-codebase | here ]]. More details in inline comments below. Test Plan: [[ https://www.shellcheck.net/ | ShellCheck ]], close reading. Reviewers: ashoat, atul, palys-swm Reviewed By: ashoat Subscribers: Adrian, karol-bisztyga Differential Revision: https://phab.comm.dev/D4450
129,203
07.07.2022 11:39:57
14,400
8dd41c6dc66be20464bf23cdd53b3b5631967f28
[native] Clean up `detect_abis.sh` Summary: Relevant Linear issue [[ | here ]]. More details in inline comments. Test Plan: [[ | ShellCheck ]], close reading. Reviewers: ashoat, atul, karol-bisztyga Subscribers: palys-swm, Adrian
[ { "change_type": "MODIFY", "old_path": "native/android/app/bash/detect_abis.sh", "new_path": "native/android/app/bash/detect_abis.sh", "diff": "@@ -7,7 +7,7 @@ ABIS=()\nfor ID in ${IDS}\ndo\n- ABI=\"$(adb -s $ID shell getprop ro.product.cpu.abi)\"\n+ ABI=$(adb -s \"$ID\" shell getprop ro.product.cpu.abi)\n# check if we already have this ABI\nif [[ \" ${ABIS[*]} \" =~ \" ${ABI} \" ]]; then\ncontinue\n@@ -15,4 +15,4 @@ do\nABIS+=\"${ABI} \"\ndone\n-echo $ABIS\n+echo \"$ABIS\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Clean up `detect_abis.sh` Summary: Relevant Linear issue [[ https://linear.app/comm/issue/ENG-1295/clean-up-shell-scripts-in-codebase | here ]]. More details in inline comments. Test Plan: [[ https://www.shellcheck.net/ | ShellCheck ]], close reading. Reviewers: ashoat, atul, karol-bisztyga Reviewed By: atul Subscribers: palys-swm, Adrian Differential Revision: https://phab.comm.dev/D4479
129,190
30.06.2022 15:33:57
-7,200
d2dfb7c29002cc414d5f999e8e9ec829d69faf2b
[services] Tests - Add chunk limit to tools Summary: Depends on D4247 Adding an equivalent to `GRPC_CHUNK_SIZE_LIMIT` Test Plan: none really Reviewers: palys-swm, varun Subscribers: ashoat, palys-swm, Adrian, atul, yayabosh
[ { "change_type": "MODIFY", "old_path": "services/commtest/tests/lib/tools.rs", "new_path": "services/commtest/tests/lib/tools.rs", "diff": "@@ -18,5 +18,12 @@ pub enum Error {\nTonicStatus(tonic::Status),\n}\n+pub const GRPC_METADATA_SIZE_BYTES: usize = 5;\n+\n+#[allow(dead_code)]\n+pub fn get_grpc_chunk_size_limit() -> usize {\n+ (ByteSize::mib(4).as_u64() as usize) - GRPC_METADATA_SIZE_BYTES\n+}\n+\n#[allow(dead_code)]\npub const ATTACHMENT_DELIMITER: &str = \";\";\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Tests - Add chunk limit to tools Summary: Depends on D4247 Adding an equivalent to `GRPC_CHUNK_SIZE_LIMIT` - https://github.com/CommE2E/comm/blob/7e9032d9732db37fadbc2761ccfa3baac5875b2d/services/lib/src/GlobalConstants.h#L20 Test Plan: none really Reviewers: palys-swm, varun Reviewed By: palys-swm, varun Subscribers: ashoat, palys-swm, Adrian, atul, yayabosh Differential Revision: https://phab.comm.dev/D4248
129,190
30.06.2022 15:33:59
-7,200
3871d95d9e367b82e4a9d1689858be119f6078e4
[services] Tests - Update packages Summary: Depends on D4248 I updated the list of packages necessary for the tests to run. Test Plan: `cd services/commtest && COMM_TEST_TARGET=backup cargo build` Reviewers: palys-swm, varun, ashoat Subscribers: ashoat, palys-swm, Adrian, atul, yayabosh
[ { "change_type": "MODIFY", "old_path": "services/commtest/Cargo.lock", "new_path": "services/commtest/Cargo.lock", "diff": "@@ -17,12 +17,50 @@ version = \"1.0.45\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"ee10e43ae4a853c0a3591d4e2ada1719e553be18199d9da9d4a83f5927c2f5c7\"\n+[[package]]\n+name = \"async-stream\"\n+version = \"0.3.2\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"171374e7e3b2504e0e5236e3b59260560f9fe94bfe9ac39ba5e4e929c5590625\"\n+dependencies = [\n+ \"async-stream-impl\",\n+ \"futures-core\",\n+]\n+\n+[[package]]\n+name = \"async-stream-impl\"\n+version = \"0.3.2\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"648ed8c8d2ce5409ccd57453d9d1b214b342a0d69376a6feda1fd6cae3299308\"\n+dependencies = [\n+ \"proc-macro2\",\n+ \"quote\",\n+ \"syn\",\n+]\n+\n+[[package]]\n+name = \"async-trait\"\n+version = \"0.1.51\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e\"\n+dependencies = [\n+ \"proc-macro2\",\n+ \"quote\",\n+ \"syn\",\n+]\n+\n[[package]]\nname = \"autocfg\"\nversion = \"1.0.1\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a\"\n+[[package]]\n+name = \"base64\"\n+version = \"0.13.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd\"\n+\n[[package]]\nname = \"bitflags\"\nversion = \"1.3.2\"\n@@ -51,8 +89,13 @@ checksum = \"baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd\"\nname = \"commtest\"\nversion = \"0.1.0\"\ndependencies = [\n+ \"async-stream\",\n\"bytesize\",\n\"derive_more\",\n+ \"futures\",\n+ \"prost\",\n+ \"tokio\",\n+ \"tonic\",\n\"tonic-build\",\n]\n@@ -87,6 +130,58 @@ version = \"0.4.0\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"398ea4fabe40b9b0d885340a2a991a44c8a645624075ad966d21f88688e2b69e\"\n+[[package]]\n+name = \"fnv\"\n+version = \"1.0.7\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1\"\n+\n+[[package]]\n+name = \"futures\"\n+version = \"0.1.31\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678\"\n+\n+[[package]]\n+name = \"futures-channel\"\n+version = \"0.3.17\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888\"\n+dependencies = [\n+ \"futures-core\",\n+]\n+\n+[[package]]\n+name = \"futures-core\"\n+version = \"0.3.17\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d\"\n+\n+[[package]]\n+name = \"futures-sink\"\n+version = \"0.3.17\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11\"\n+\n+[[package]]\n+name = \"futures-task\"\n+version = \"0.3.17\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99\"\n+\n+[[package]]\n+name = \"futures-util\"\n+version = \"0.3.17\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481\"\n+dependencies = [\n+ \"autocfg\",\n+ \"futures-core\",\n+ \"futures-task\",\n+ \"pin-project-lite\",\n+ \"pin-utils\",\n+]\n+\n[[package]]\nname = \"getrandom\"\nversion = \"0.2.3\"\n@@ -98,6 +193,25 @@ dependencies = [\n\"wasi\",\n]\n+[[package]]\n+name = \"h2\"\n+version = \"0.3.7\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"7fd819562fcebdac5afc5c113c3ec36f902840b70fd4fc458799c8ce4607ae55\"\n+dependencies = [\n+ \"bytes\",\n+ \"fnv\",\n+ \"futures-core\",\n+ \"futures-sink\",\n+ \"futures-util\",\n+ \"http\",\n+ \"indexmap\",\n+ \"slab\",\n+ \"tokio\",\n+ \"tokio-util\",\n+ \"tracing\",\n+]\n+\n[[package]]\nname = \"hashbrown\"\nversion = \"0.11.2\"\n@@ -113,6 +227,85 @@ dependencies = [\n\"unicode-segmentation\",\n]\n+[[package]]\n+name = \"hermit-abi\"\n+version = \"0.1.19\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33\"\n+dependencies = [\n+ \"libc\",\n+]\n+\n+[[package]]\n+name = \"http\"\n+version = \"0.2.5\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b\"\n+dependencies = [\n+ \"bytes\",\n+ \"fnv\",\n+ \"itoa\",\n+]\n+\n+[[package]]\n+name = \"http-body\"\n+version = \"0.4.4\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6\"\n+dependencies = [\n+ \"bytes\",\n+ \"http\",\n+ \"pin-project-lite\",\n+]\n+\n+[[package]]\n+name = \"httparse\"\n+version = \"1.5.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503\"\n+\n+[[package]]\n+name = \"httpdate\"\n+version = \"1.0.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440\"\n+\n+[[package]]\n+name = \"hyper\"\n+version = \"0.14.14\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"2b91bb1f221b6ea1f1e4371216b70f40748774c2fb5971b450c07773fb92d26b\"\n+dependencies = [\n+ \"bytes\",\n+ \"futures-channel\",\n+ \"futures-core\",\n+ \"futures-util\",\n+ \"h2\",\n+ \"http\",\n+ \"http-body\",\n+ \"httparse\",\n+ \"httpdate\",\n+ \"itoa\",\n+ \"pin-project-lite\",\n+ \"socket2\",\n+ \"tokio\",\n+ \"tower-service\",\n+ \"tracing\",\n+ \"want\",\n+]\n+\n+[[package]]\n+name = \"hyper-timeout\"\n+version = \"0.4.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1\"\n+dependencies = [\n+ \"hyper\",\n+ \"pin-project-lite\",\n+ \"tokio\",\n+ \"tokio-io-timeout\",\n+]\n+\n[[package]]\nname = \"indexmap\"\nversion = \"1.7.0\"\n@@ -132,6 +325,12 @@ dependencies = [\n\"either\",\n]\n+[[package]]\n+name = \"itoa\"\n+version = \"0.4.8\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4\"\n+\n[[package]]\nname = \"lazy_static\"\nversion = \"1.4.0\"\n@@ -159,12 +358,59 @@ version = \"2.4.1\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a\"\n+[[package]]\n+name = \"mio\"\n+version = \"0.7.14\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc\"\n+dependencies = [\n+ \"libc\",\n+ \"log\",\n+ \"miow\",\n+ \"ntapi\",\n+ \"winapi\",\n+]\n+\n+[[package]]\n+name = \"miow\"\n+version = \"0.3.7\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21\"\n+dependencies = [\n+ \"winapi\",\n+]\n+\n[[package]]\nname = \"multimap\"\nversion = \"0.8.3\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a\"\n+[[package]]\n+name = \"ntapi\"\n+version = \"0.3.6\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44\"\n+dependencies = [\n+ \"winapi\",\n+]\n+\n+[[package]]\n+name = \"num_cpus\"\n+version = \"1.13.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3\"\n+dependencies = [\n+ \"hermit-abi\",\n+ \"libc\",\n+]\n+\n+[[package]]\n+name = \"percent-encoding\"\n+version = \"2.1.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e\"\n+\n[[package]]\nname = \"pest\"\nversion = \"2.1.3\"\n@@ -184,6 +430,38 @@ dependencies = [\n\"indexmap\",\n]\n+[[package]]\n+name = \"pin-project\"\n+version = \"1.0.8\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"576bc800220cc65dac09e99e97b08b358cfab6e17078de8dc5fee223bd2d0c08\"\n+dependencies = [\n+ \"pin-project-internal\",\n+]\n+\n+[[package]]\n+name = \"pin-project-internal\"\n+version = \"1.0.8\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389\"\n+dependencies = [\n+ \"proc-macro2\",\n+ \"quote\",\n+ \"syn\",\n+]\n+\n+[[package]]\n+name = \"pin-project-lite\"\n+version = \"0.2.7\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443\"\n+\n+[[package]]\n+name = \"pin-utils\"\n+version = \"0.1.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184\"\n+\n[[package]]\nname = \"ppv-lite86\"\nversion = \"0.2.15\"\n@@ -363,6 +641,22 @@ dependencies = [\n\"pest\",\n]\n+[[package]]\n+name = \"slab\"\n+version = \"0.4.5\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5\"\n+\n+[[package]]\n+name = \"socket2\"\n+version = \"0.4.2\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516\"\n+dependencies = [\n+ \"libc\",\n+ \"winapi\",\n+]\n+\n[[package]]\nname = \"syn\"\nversion = \"1.0.81\"\n@@ -388,6 +682,100 @@ dependencies = [\n\"winapi\",\n]\n+[[package]]\n+name = \"tokio\"\n+version = \"1.13.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"588b2d10a336da58d877567cd8fb8a14b463e2104910f8132cd054b4b96e29ee\"\n+dependencies = [\n+ \"autocfg\",\n+ \"bytes\",\n+ \"libc\",\n+ \"memchr\",\n+ \"mio\",\n+ \"num_cpus\",\n+ \"pin-project-lite\",\n+ \"tokio-macros\",\n+ \"winapi\",\n+]\n+\n+[[package]]\n+name = \"tokio-io-timeout\"\n+version = \"1.1.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"90c49f106be240de154571dd31fbe48acb10ba6c6dd6f6517ad603abffa42de9\"\n+dependencies = [\n+ \"pin-project-lite\",\n+ \"tokio\",\n+]\n+\n+[[package]]\n+name = \"tokio-macros\"\n+version = \"1.5.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"114383b041aa6212c579467afa0075fbbdd0718de036100bc0ba7961d8cb9095\"\n+dependencies = [\n+ \"proc-macro2\",\n+ \"quote\",\n+ \"syn\",\n+]\n+\n+[[package]]\n+name = \"tokio-stream\"\n+version = \"0.1.8\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3\"\n+dependencies = [\n+ \"futures-core\",\n+ \"pin-project-lite\",\n+ \"tokio\",\n+]\n+\n+[[package]]\n+name = \"tokio-util\"\n+version = \"0.6.9\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0\"\n+dependencies = [\n+ \"bytes\",\n+ \"futures-core\",\n+ \"futures-sink\",\n+ \"log\",\n+ \"pin-project-lite\",\n+ \"tokio\",\n+]\n+\n+[[package]]\n+name = \"tonic\"\n+version = \"0.6.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"24203b79cf2d68909da91178db3026e77054effba0c5d93deb870d3ca7b35afa\"\n+dependencies = [\n+ \"async-stream\",\n+ \"async-trait\",\n+ \"base64\",\n+ \"bytes\",\n+ \"futures-core\",\n+ \"futures-util\",\n+ \"h2\",\n+ \"http\",\n+ \"http-body\",\n+ \"hyper\",\n+ \"hyper-timeout\",\n+ \"percent-encoding\",\n+ \"pin-project\",\n+ \"prost\",\n+ \"prost-derive\",\n+ \"tokio\",\n+ \"tokio-stream\",\n+ \"tokio-util\",\n+ \"tower\",\n+ \"tower-layer\",\n+ \"tower-service\",\n+ \"tracing\",\n+ \"tracing-futures\",\n+]\n+\n[[package]]\nname = \"tonic-build\"\nversion = \"0.6.0\"\n@@ -400,6 +788,88 @@ dependencies = [\n\"syn\",\n]\n+[[package]]\n+name = \"tower\"\n+version = \"0.4.10\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"c00e500fff5fa1131c866b246041a6bf96da9c965f8fe4128cb1421f23e93c00\"\n+dependencies = [\n+ \"futures-core\",\n+ \"futures-util\",\n+ \"indexmap\",\n+ \"pin-project\",\n+ \"pin-project-lite\",\n+ \"rand\",\n+ \"slab\",\n+ \"tokio\",\n+ \"tokio-stream\",\n+ \"tokio-util\",\n+ \"tower-layer\",\n+ \"tower-service\",\n+ \"tracing\",\n+]\n+\n+[[package]]\n+name = \"tower-layer\"\n+version = \"0.3.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62\"\n+\n+[[package]]\n+name = \"tower-service\"\n+version = \"0.3.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6\"\n+\n+[[package]]\n+name = \"tracing\"\n+version = \"0.1.29\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105\"\n+dependencies = [\n+ \"cfg-if\",\n+ \"log\",\n+ \"pin-project-lite\",\n+ \"tracing-attributes\",\n+ \"tracing-core\",\n+]\n+\n+[[package]]\n+name = \"tracing-attributes\"\n+version = \"0.1.18\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e\"\n+dependencies = [\n+ \"proc-macro2\",\n+ \"quote\",\n+ \"syn\",\n+]\n+\n+[[package]]\n+name = \"tracing-core\"\n+version = \"0.1.21\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4\"\n+dependencies = [\n+ \"lazy_static\",\n+]\n+\n+[[package]]\n+name = \"tracing-futures\"\n+version = \"0.2.5\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2\"\n+dependencies = [\n+ \"pin-project\",\n+ \"tracing\",\n+]\n+\n+[[package]]\n+name = \"try-lock\"\n+version = \"0.2.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642\"\n+\n[[package]]\nname = \"ucd-trie\"\nversion = \"0.1.3\"\n@@ -418,6 +888,16 @@ version = \"0.2.2\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3\"\n+[[package]]\n+name = \"want\"\n+version = \"0.3.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0\"\n+dependencies = [\n+ \"log\",\n+ \"try-lock\",\n+]\n+\n[[package]]\nname = \"wasi\"\nversion = \"0.10.2+wasi-snapshot-preview1\"\n" }, { "change_type": "MODIFY", "old_path": "services/commtest/Cargo.toml", "new_path": "services/commtest/Cargo.toml", "diff": "@@ -4,6 +4,12 @@ version = \"0.1.0\"\nedition = \"2021\"\n[dependencies]\n+tonic = \"0.6\"\n+tokio = { version = \"1.0\", features = [\"macros\", \"rt-multi-thread\"] }\n+prost = \"0.9\"\n+futures = \"0.1\"\n+async-stream = \"0.3.2\"\n+derive_more = \"0.99.16\"\nbytesize = \"1.1.0\"\n[build-dependencies]\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Tests - Update packages Summary: Depends on D4248 I updated the list of packages necessary for the tests to run. Test Plan: `cd services/commtest && COMM_TEST_TARGET=backup cargo build` Reviewers: palys-swm, varun, ashoat Reviewed By: varun, ashoat Subscribers: ashoat, palys-swm, Adrian, atul, yayabosh Differential Revision: https://phab.comm.dev/D4249
129,190
30.06.2022 15:34:21
-7,200
8810a366fdc6f8bec147e3ff675abd793bd3dd6d
[services] Tests - Blob - Add Put Summary: Depends on D4273 Adding `Put` method to blob's tests. Test Plan: For now, this method's not invoked. The Rust project should build normally. Reviewers: palys-swm, varun Subscribers: ashoat, palys-swm, Adrian, atul, yayabosh
[ { "change_type": "ADD", "old_path": null, "new_path": "services/commtest/tests/blob/put.rs", "diff": "+#[path = \"./blob_utils.rs\"]\n+mod blob_utils;\n+#[path = \"../lib/tools.rs\"]\n+mod tools;\n+\n+use crate::blob_utils::{\n+ proto::put_request::Data::*, proto::PutRequest, BlobData, BlobServiceClient,\n+};\n+\n+use tonic::Request;\n+\n+use crate::tools::{generate_nbytes, Error};\n+\n+pub async fn run(\n+ client: &mut BlobServiceClient<tonic::transport::Channel>,\n+ blob_data: &BlobData,\n+) -> Result<bool, Error> {\n+ let cloned_holder = blob_data.holder.clone();\n+ let cloned_hash = blob_data.hash.clone();\n+ let cloned_chunks_sizes = blob_data.chunks_sizes.clone();\n+ println!(\"put {}\", cloned_holder);\n+\n+ let outbound = async_stream::stream! {\n+ println!(\" - sending holder\");\n+ let request = PutRequest {\n+ data: Some(Holder(cloned_holder.to_string())),\n+ };\n+ yield request;\n+ println!(\" - sending hash\");\n+ let request = PutRequest {\n+ data: Some(BlobHash(cloned_hash.to_string())),\n+ };\n+ yield request;\n+ for chunk_size in cloned_chunks_sizes {\n+ println!(\" - sending data chunk {}\", chunk_size);\n+ let request = PutRequest {\n+ data: Some(DataChunk(generate_nbytes(chunk_size, None))),\n+ };\n+ yield request;\n+ }\n+ };\n+\n+ let mut data_exists: bool = false;\n+ let response = client.put(Request::new(outbound)).await?;\n+ let mut inbound = response.into_inner();\n+ while let Some(response) = inbound.message().await? {\n+ data_exists = data_exists || response.data_exists;\n+ }\n+ Ok(data_exists)\n+}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Tests - Blob - Add Put Summary: Depends on D4273 Adding `Put` method to blob's tests. Test Plan: For now, this method's not invoked. The Rust project should build normally. Reviewers: palys-swm, varun Reviewed By: palys-swm, varun Subscribers: ashoat, palys-swm, Adrian, atul, yayabosh Differential Revision: https://phab.comm.dev/D4274
129,190
30.06.2022 15:34:23
-7,200
23ee43573ca07792eafb30eb3bf36738e4e700d7
[services] Tests - Blob - Add Get Summary: Depends on D4274 Adding `Get` method to blob's tests. Test Plan: For now, this method's not invoked. The Rust project should build normally. Reviewers: palys-swm, varun Subscribers: ashoat, palys-swm, Adrian, atul, yayabosh
[ { "change_type": "ADD", "old_path": null, "new_path": "services/commtest/tests/blob/get.rs", "diff": "+#[path = \"./blob_utils.rs\"]\n+mod blob_utils;\n+#[path = \"../lib/tools.rs\"]\n+mod tools;\n+\n+use tonic::Request;\n+\n+use crate::blob_utils::{proto::GetRequest, BlobData, BlobServiceClient};\n+use crate::tools::Error;\n+\n+pub async fn run(\n+ client: &mut BlobServiceClient<tonic::transport::Channel>,\n+ blob_data: &BlobData,\n+) -> Result<Vec<usize>, Error> {\n+ let cloned_holder = blob_data.holder.clone();\n+ println!(\"get {}\", cloned_holder);\n+\n+ let response = client\n+ .get(Request::new(GetRequest {\n+ holder: cloned_holder,\n+ }))\n+ .await?;\n+ let mut inbound = response.into_inner();\n+ let mut sizes: Vec<usize> = Vec::new();\n+ while let Some(response) = inbound.message().await? {\n+ sizes.push(response.data_chunk.len());\n+ }\n+ Ok(sizes)\n+}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Tests - Blob - Add Get Summary: Depends on D4274 Adding `Get` method to blob's tests. Test Plan: For now, this method's not invoked. The Rust project should build normally. Reviewers: palys-swm, varun Reviewed By: palys-swm, varun Subscribers: ashoat, palys-swm, Adrian, atul, yayabosh Differential Revision: https://phab.comm.dev/D4275
129,190
30.06.2022 15:34:25
-7,200
02caf33e16fee91321236bfd70ee11de8447b876
[services] Tests - Blob - Add Remove Summary: Depends on D4275 Adding `Remove` method to blob's tests. Test Plan: For now, this method's not invoked. The Rust project should build normally. Reviewers: palys-swm, varun Subscribers: ashoat, palys-swm, Adrian, atul, yayabosh
[ { "change_type": "ADD", "old_path": null, "new_path": "services/commtest/tests/blob/remove.rs", "diff": "+#[path = \"./blob_utils.rs\"]\n+mod blob_utils;\n+#[path = \"../lib/tools.rs\"]\n+mod tools;\n+\n+use tonic::Request;\n+\n+use crate::blob_utils::{proto::RemoveRequest, BlobData, BlobServiceClient};\n+use crate::tools::Error;\n+\n+pub async fn run(\n+ client: &mut BlobServiceClient<tonic::transport::Channel>,\n+ blob_data: &BlobData,\n+) -> Result<(), Error> {\n+ let cloned_holder = blob_data.holder.clone();\n+ println!(\"remove {}\", cloned_holder);\n+\n+ client\n+ .remove(Request::new(RemoveRequest {\n+ holder: cloned_holder,\n+ }))\n+ .await?;\n+ Ok(())\n+}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Tests - Blob - Add Remove Summary: Depends on D4275 Adding `Remove` method to blob's tests. Test Plan: For now, this method's not invoked. The Rust project should build normally. Reviewers: palys-swm, varun Reviewed By: palys-swm, varun Subscribers: ashoat, palys-swm, Adrian, atul, yayabosh Differential Revision: https://phab.comm.dev/D4276
129,190
30.06.2022 15:34:37
-7,200
cc745f3bbc81e12129ae8578701cf36d8b1b7d7b
[services] Backup - Send Log - Check the real item size Summary: Depends on D4411 Test Plan: Services build, for now this went out of sync with the integration tests Reviewers: palys-swm Subscribers: ashoat, palys-swm, Adrian, atul, yayabosh
[ { "change_type": "MODIFY", "old_path": "services/backup/src/Reactors/server/SendLogReactor.cpp", "new_path": "services/backup/src/Reactors/server/SendLogReactor.cpp", "diff": "@@ -20,6 +20,13 @@ void SendLogReactor::storeInDatabase() {\nstoredInBlob ? this->blobHolder : this->value,\n{},\nthis->hash);\n+ if (database::LogItem::getItemSize(&logItem) > LOG_DATA_SIZE_DATABASE_LIMIT) {\n+ throw std::runtime_error(\n+ \"trying to put into the database an item with size \" +\n+ std::to_string(database::LogItem::getItemSize(&logItem)) +\n+ \" that exceeds the limit \" +\n+ std::to_string(LOG_DATA_SIZE_DATABASE_LIMIT));\n+ }\ndatabase::DatabaseManager::getInstance().putLogItem(logItem);\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Backup - Send Log - Check the real item size Summary: Depends on D4411 https://linear.app/comm/issue/ENG-1288/properly-handle-the-dynamodb-item-size-limit Test Plan: Services build, for now this went out of sync with the integration tests Reviewers: palys-swm Reviewed By: palys-swm Subscribers: ashoat, palys-swm, Adrian, atul, yayabosh Differential Revision: https://phab.comm.dev/D4412
129,190
30.06.2022 16:08:14
-7,200
68aa78321a3ce0837f0f96fef725e5b25e711f1b
[services] Tests - run cargo fmt Summary: Depends on D4379 Something's wrong, `cargo fmt` should be fired up in git pre commit hooks, this should be fixed. Test Plan: - Reviewers: varun, ashoat Subscribers: varun, ashoat, palys-swm, Adrian, atul, yayabosh
[ { "change_type": "MODIFY", "old_path": "services/commtest/tests/backup/add_attachments.rs", "new_path": "services/commtest/tests/backup/add_attachments.rs", "diff": "@@ -24,11 +24,11 @@ pub async fn run(\nlet log_id = backup_data.log_items[index].id.clone();\nprintln!(\"add attachments for log {}/{}\", index, log_id);\nlog_id\n- },\n+ }\nNone => {\nprintln!(\"add attachments for backup\");\nString::new()\n- },\n+ }\n};\nlet holders: String = match log_index {\n" }, { "change_type": "MODIFY", "old_path": "services/commtest/tests/backup/pull_backup.rs", "new_path": "services/commtest/tests/backup/pull_backup.rs", "diff": "@@ -51,18 +51,15 @@ pub async fn run(\nlet mut backup_id: Option<String> = None;\nlet mut log_id: Option<String> = None;\nmatch id {\n- Some(BackupId(id)) => {\n- backup_id = Some(id)\n- },\n- Some(LogId(id)) => {\n- log_id = Some(id)\n- },\n- None => {},\n+ Some(BackupId(id)) => backup_id = Some(id),\n+ Some(LogId(id)) => log_id = Some(id),\n+ None => {}\n};\nmatch response_data {\nSome(CompactionChunk(chunk)) => {\nassert_eq!(\n- state, State::Compaction,\n+ state,\n+ State::Compaction,\n\"invalid state, expected compaction, got {:?}\",\nstate\n);\n@@ -81,9 +78,11 @@ pub async fn run(\nassert_eq!(state, State::Log, \"invalid state, expected compaction\");\nlet log_id = log_id.ok_or(IOError::new(ErrorKind::Other, \"log id expected but not received\"))?;\nif log_id != current_id {\n- result\n- .log_items\n- .push(Item::new(log_id.clone(), Vec::new(), Vec::new()));\n+ result.log_items.push(Item::new(\n+ log_id.clone(),\n+ Vec::new(),\n+ Vec::new(),\n+ ));\ncurrent_id = log_id;\n}\nlet log_items_size = result.log_items.len() - 1;\n@@ -120,7 +119,7 @@ pub async fn run(\n}\n}\n}\n- None => {},\n+ None => {}\n}\n}\nOk(result)\n" }, { "change_type": "MODIFY", "old_path": "services/commtest/tests/blob_test.rs", "new_path": "services/commtest/tests/blob_test.rs", "diff": "@@ -17,8 +17,10 @@ use tools::Error;\n#[tokio::test]\nasync fn blob_test() -> Result<(), Error> {\n- let port = env::var(\"COMM_SERVICES_PORT_BLOB\").expect(\"port env var expected but not received\");\n- let mut client = BlobServiceClient::connect(format!(\"http://localhost:{}\", port)).await?;\n+ let port = env::var(\"COMM_SERVICES_PORT_BLOB\")\n+ .expect(\"port env var expected but not received\");\n+ let mut client =\n+ BlobServiceClient::connect(format!(\"http://localhost:{}\", port)).await?;\nlet blob_data = vec![\nBlobData {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Tests - run cargo fmt Summary: Depends on D4379 Something's wrong, `cargo fmt` should be fired up in git pre commit hooks, this should be fixed. Test Plan: - Reviewers: varun, ashoat Reviewed By: varun, ashoat Subscribers: varun, ashoat, palys-swm, Adrian, atul, yayabosh Differential Revision: https://phab.comm.dev/D4413
129,190
05.07.2022 09:10:30
-7,200
35a55850500012c6252663f297bbbf051b5cb5bb
[services] Add reset local cloud command Summary: Depends on D4425 Adding a reset command to the services' package.json so it is easier to reset the local cloud. Test Plan: ``` cd services yarn reset-local-cloud ``` Reviewers: palys-swm Subscribers: ashoat, palys-swm, Adrian, atul, yayabosh
[ { "change_type": "MODIFY", "old_path": "services/package.json", "new_path": "services/package.json", "diff": "\"run-integration-tests\": \"./scripts/run_integration_tests.sh\",\n\"run-all-services-in-sandbox\": \"COMM_SERVICES_SANDBOX=1 ./scripts/run_all_services.sh\",\n\"init-local-cloud\": \"./scripts/init_local_cloud.sh\",\n- \"delete-local-cloud\": \"docker-compose down -v\"\n+ \"delete-local-cloud\": \"docker-compose down -v\",\n+ \"reset-local-cloud\": \"yarn delete-local-cloud && yarn init-local-cloud\"\n}\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Add reset local cloud command Summary: Depends on D4425 Adding a reset command to the services' package.json so it is easier to reset the local cloud. Test Plan: ``` cd services yarn reset-local-cloud ``` Reviewers: palys-swm Reviewed By: palys-swm Subscribers: ashoat, palys-swm, Adrian, atul, yayabosh Differential Revision: https://phab.comm.dev/D4437
129,203
08.07.2022 10:20:00
14,400
7cac76eb32619adeffa18c2ee52ba61b5b596d07
[keyserver] Delete `deploy.sh` Summary: See [[ | comment ]] on D4477. This diff removes `deploy.sh` since we don't use it anymore and instead use Docker in production. Test Plan: N/A Reviewers: ashoat, atul Subscribers: palys-swm, Adrian, ashoat
[ { "change_type": "DELETE", "old_path": "keyserver/bash/deploy.sh", "new_path": null, "diff": "-#!/usr/bin/env bash\n-\n-# run as: ssh user on root wheel\n-# run from: wherever\n-# param: path to link to\n-\n-# The maximum amount of space to spend on checkouts. By default we leave around\n-# old deployments in case we want to roll back. The limit includes the current\n-# prod checkout, but will never delete prod.\n-MAX_DISK_USAGE_KB=3145728 # 3 GiB\n-\n-# The user that spawns the Node server\n-DAEMON_USER=comm\n-\n-# Input to git clone\n-GIT_CLONE_PARAMS=https://github.com/CommE2E/comm.git\n-\n-set -e\n-[[ `whoami` = root ]] || exec sudo su -c \"$0 $1\"\n-\n-# STEP 1: clone source into new directory\n-CHECKOUT_PATH=$1.$(date +%F-%H-%M)\n-rm -rf \"$CHECKOUT_PATH\" # badass. risky\n-mkdir -p \"$CHECKOUT_PATH\"\n-chown $DAEMON_USER:$DAEMON_USER \"$CHECKOUT_PATH\"\n-su $DAEMON_USER -c \"git clone $GIT_CLONE_PARAMS '$CHECKOUT_PATH'\"\n-su $DAEMON_USER -c \"cp -r '$1'/keyserver/secrets '$CHECKOUT_PATH'/keyserver/secrets\"\n-su $DAEMON_USER -c \"cp -r '$1'/keyserver/facts '$CHECKOUT_PATH'/keyserver/facts\"\n-cd \"$CHECKOUT_PATH\"\n-su $DAEMON_USER -c \"keyserver/bash/setup.sh\"\n-\n-# STEP 2: test if the binary crashes within 60 seconds\n-set +e\n-su $DAEMON_USER -c \"cd keyserver && PORT=3001 timeout 60 bash/run-prod.sh\"\n-[[ $? -eq 124 ]] || exit 1\n-set -e\n-\n-# STEP 3: flip it over\n-systemctl stop comm || true\n-rm \"$1\"\n-ln -s \"$CHECKOUT_PATH\" \"$1\"\n-chown -h $DAEMON_USER:$DAEMON_USER \"$1\"\n-systemctl restart comm\n-\n-# STEP 4: clean out old checkouts\n-checkouts=($(ls -dtr \"$1\".*))\n-for checkout in \"${checkouts[@]}\"; do\n- if [[ \"$checkout\" = \"$CHECKOUT_PATH\" ]]; then\n- break\n- fi\n- TOTAL_USAGE=$(sudo du -cs $1* | grep total | awk '{ print $1 }')\n- if [[ $TOTAL_USAGE -le $MAX_DISK_USAGE_KB ]]; then\n- break\n- fi\n- rm -rf \"$checkout\"\n-done\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[keyserver] Delete `deploy.sh` Summary: See @ashoat's [[ https://phab.comm.dev/D4477#127356 | comment ]] on D4477. This diff removes `deploy.sh` since we don't use it anymore and instead use Docker in production. Test Plan: N/A Reviewers: ashoat, atul Reviewed By: ashoat, atul Subscribers: palys-swm, Adrian, ashoat Differential Revision: https://phab.comm.dev/D4484
129,203
08.07.2022 16:00:47
14,400
d9e99fc9e2b3ef05b6ded5dc6423f2486d9d35fe
[CI] Add emojis to Buildkite pipelines Summary: Super quick change that adds a `label` to each Buildkite pipeline's YAML file. You can see the emojis here: Test Plan: Ran builds in Buildkite and saw emojis. Reviewers: atul, palys-swm Subscribers: ashoat, Adrian
[ { "change_type": "MODIFY", "old_path": ".buildkite/android.yml", "new_path": ".buildkite/android.yml", "diff": "steps:\n- - command:\n+ - label: \":robot_face: Android Build\"\n+ command:\n- 'yarn cleaninstall --frozen-lockfile --skip-optional'\n- 'cd native/android'\n- './gradlew bundleRelease --no-daemon \"-Dorg.gradle.jvmargs=-Xmx32g -XX:MaxPermSize=32g -XX:+HeapDumpOnOutOfMemoryError\"'\n" }, { "change_type": "MODIFY", "old_path": ".buildkite/backup_build.yml", "new_path": ".buildkite/backup_build.yml", "diff": "steps:\n- - command: 'cd services && docker-compose build --no-cache backup-server'\n+ - label: \":docker: Backup Build (Docker)\"\n+ command: 'cd services && docker-compose build --no-cache backup-server'\nagents:\n- 'autoscaling=true'\n" }, { "change_type": "MODIFY", "old_path": ".buildkite/blob_build.yml", "new_path": ".buildkite/blob_build.yml", "diff": "steps:\n- - command: 'cd services && docker-compose build --no-cache blob-server'\n+ - label: \":docker: Blob Build (Docker)\"\n+ command: 'cd services && docker-compose build --no-cache blob-server'\nagents:\n- 'autoscaling=true'\n" }, { "change_type": "MODIFY", "old_path": ".buildkite/docker_keyserver.yml", "new_path": ".buildkite/docker_keyserver.yml", "diff": "steps:\n- - command:\n- - 'cd keyserver && touch .env && bash/dc.sh build --no-cache'\n+ - label: \":docker: Keyserver Build (Docker)\"\n+ command: 'cd keyserver && touch .env && bash/dc.sh build --no-cache'\nagents:\n- 'autoscaling=true'\n" }, { "change_type": "MODIFY", "old_path": ".buildkite/eslint_flow_jest.yml", "new_path": ".buildkite/eslint_flow_jest.yml", "diff": "steps:\n- - command:\n+ - label: \":eslint: :jest: ESLint & Flow & Jest\"\n+ command:\n- '(pkill flow || true)'\n- 'yarn cleaninstall --frozen-lockfile --skip-optional'\n- 'yarn eslint --max-warnings=0 & yarn workspace lib flow & yarn workspace web flow & yarn workspace landing flow & yarn workspace native flow & yarn workspace keyserver flow'\n" }, { "change_type": "MODIFY", "old_path": ".buildkite/identity_build.yml", "new_path": ".buildkite/identity_build.yml", "diff": "steps:\n- - command: 'cd services && docker-compose build --no-cache identity-server'\n+ - label: \":docker: Identity Build (Docker)\"\n+ command: 'cd services && docker-compose build --no-cache identity-server'\nagents:\n- 'autoscaling=true'\n" }, { "change_type": "MODIFY", "old_path": ".buildkite/ios.yml", "new_path": ".buildkite/ios.yml", "diff": "steps:\n- - command:\n+ - label: \":ios: iOS Build\"\n+ command:\n- 'pod repo update && yarn workspace native clean-ios'\n- 'yarn cleaninstall --frozen-lockfile --skip-optional'\n- 'cd native/ios && xcodebuild -workspace Comm.xcworkspace -scheme Comm -destination generic/platform=iOS -allowProvisioningUpdates'\n" }, { "change_type": "MODIFY", "old_path": ".buildkite/tunnelbroker_build.yml", "new_path": ".buildkite/tunnelbroker_build.yml", "diff": "steps:\n- - command: 'cd services && docker-compose build --no-cache tunnelbroker-server'\n+ - label: \":docker: Tunnelbroker Build (Docker)\"\n+ command: 'cd services && docker-compose build --no-cache tunnelbroker-server'\nagents:\n- 'autoscaling=true'\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[CI] Add emojis to Buildkite pipelines Summary: Super quick change that adds a `label` to each Buildkite pipeline's YAML file. You can see the emojis here: https://github.com/buildkite/emojis Test Plan: Ran builds in Buildkite and saw emojis. Reviewers: atul, palys-swm Reviewed By: atul Subscribers: ashoat, Adrian Differential Revision: https://phab.comm.dev/D4486
129,193
07.07.2022 08:40:31
25,200
331bc7da607ffa699bf3cef6f4eefed57fcdff6f
[Nix] Add cocoapods for ios build Summary: Add cocoapods to allow for pod installs Test Plan: Install XCode ``` nix develop cd native/ios && pod install && xcodebuild -workspace Comm.xcworkspace -scheme Comm -destination generic/platform=iOS -allowProvisioningUpdates ``` Reviewers: atul, ashoat, varun, marcinwasowicz Subscribers: palys-swm, Adrian, yayabosh
[ { "change_type": "MODIFY", "old_path": "nix/dev-shell.nix", "new_path": "nix/dev-shell.nix", "diff": ", boost\n, cargo\n, cmake\n+, cocoapods\n, cryptopp\n, darwin\n, folly\n@@ -52,7 +53,8 @@ mkShell {\npkg-config\nprotobuf_3_15_cmake\ngrpc\n-\n+ ] ++ lib.optionals stdenv.isDarwin [\n+ cocoapods # needed for ios\n];\n# include any libraries buildInputs\n@@ -77,6 +79,11 @@ mkShell {\nexport MYSQL_UNIX_PORT=''${XDG_RUNTIME_DIR:-/run/user/$UID}/mysql-socket/mysql.sock\nfi\n+ if [[ \"$OSTYPE\" == 'darwin'* ]]; then\n+ # Many commands for cocoapods expect the native BSD versions of commands\n+ export PATH=/usr/bin:$PATH\n+ fi\n+\necho \"Welcome to Comm dev environment! :)\"\n'';\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[Nix] Add cocoapods for ios build Summary: Add cocoapods to allow for pod installs Test Plan: Install XCode ``` nix develop cd native/ios && pod install && xcodebuild -workspace Comm.xcworkspace -scheme Comm -destination generic/platform=iOS -allowProvisioningUpdates ``` Reviewers: atul, ashoat, varun, marcinwasowicz Reviewed By: atul, ashoat Subscribers: palys-swm, Adrian, yayabosh Differential Revision: https://phab.comm.dev/D4480
129,203
12.07.2022 14:16:22
14,400
82db148f42fa113bf2849b70b59e5b401ca28fc9
[native] Merge conditionals in `InputStateContainer` Summary: Minor change which merges conditional logic in `InputStateContainer` since the code in each block is the exact same. Test Plan: Flow, close reading. Reviewers: atul, palys-swm, def-au1t Subscribers: ashoat, Adrian
[ { "change_type": "MODIFY", "old_path": "native/input/input-state-container.react.js", "new_path": "native/input/input-state-container.react.js", "diff": "@@ -495,25 +495,11 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nfor (const selection of selections) {\nconst localMediaID = getNextLocalUploadID();\nlet ids;\n- if (selection.step === 'photo_library') {\n- media.push({\n- id: localMediaID,\n- uri: selection.uri,\n- type: 'photo',\n- dimensions: selection.dimensions,\n- localMediaSelection: selection,\n- });\n- ids = { type: 'photo', localMediaID };\n- } else if (selection.step === 'photo_capture') {\n- media.push({\n- id: localMediaID,\n- uri: selection.uri,\n- type: 'photo',\n- dimensions: selection.dimensions,\n- localMediaSelection: selection,\n- });\n- ids = { type: 'photo', localMediaID };\n- } else if (selection.step === 'photo_paste') {\n+ if (\n+ selection.step === 'photo_library' ||\n+ selection.step === 'photo_capture' ||\n+ selection.step === 'photo_paste'\n+ ) {\nmedia.push({\nid: localMediaID,\nuri: selection.uri,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Merge conditionals in `InputStateContainer` Summary: Minor change which merges conditional logic in `InputStateContainer` since the code in each block is the exact same. Test Plan: Flow, close reading. Reviewers: atul, palys-swm, def-au1t Reviewed By: atul Subscribers: ashoat, Adrian Differential Revision: https://phab.comm.dev/D4509
129,196
28.06.2022 14:57:50
-7,200
99894c91276b820177d8ad06746e097c4c22537f
Implement encryption-decryption layer for elementary file operations Summary: Implements encryption-decryption layer for flat-file message store operations. Test Plan: Modify AppDelegate so that on AppLaunch it encrypts and decrypts some text then assert they are equal. Reviewers: palys-swm, varun, karol-bisztyga Subscribers: ashoat, Adrian, atul, yayabosh
[ { "change_type": "MODIFY", "old_path": "native/ios/Comm/TemporaryMessageStorage/EncryptedFileUtils.mm", "new_path": "native/ios/Comm/TemporaryMessageStorage/EncryptedFileUtils.mm", "diff": "+ (NSData *)_encryptData:(NSString *)data error:(NSError **)error;\n+ (NSString *)_decryptData:(NSString *)data error:(NSError **)error;\n@end\n+\n+@implementation EncryptedFileUtils\n++ (NSData *)_encryptData:(NSString *)data error:(NSError **)error {\n+ NSData *encryptedData = [EncryptedFileUtils\n+ _runCryptor:[data dataUsingEncoding:NSUTF8StringEncoding]\n+ operation:kCCEncrypt\n+ error:error];\n+ if (!encryptedData) {\n+ return nil;\n+ }\n+ return [encryptedData base64EncodedDataWithOptions:0];\n+}\n+\n++ (NSString *)_decryptData:(NSString *)data error:(NSError **)error {\n+ NSData *base64DecodedData = [[NSData alloc] initWithBase64EncodedString:data\n+ options:0];\n+ NSString *decryptedData = [[NSString alloc]\n+ initWithData:[EncryptedFileUtils _runCryptor:base64DecodedData\n+ operation:kCCDecrypt\n+ error:error]\n+ encoding:NSUTF8StringEncoding];\n+ if (!decryptedData) {\n+ return nil;\n+ }\n+ return decryptedData;\n+}\n+\n++ (NSData *)_runCryptor:(NSData *)binary\n+ operation:(CCOperation)operation\n+ error:(NSError **)err {\n+ NSString *keyString =\n+ [[CommSecureStoreIOSWrapper sharedInstance] get:@\"comm.encryptionKey\"];\n+ if (!keyString) {\n+ *err = [NSError\n+ errorWithDomain:@\"app.comm\"\n+ code:NSCoderValueNotFoundError\n+ userInfo:@{\n+ NSLocalizedDescriptionKey : @\"Encryption key not created yet\"\n+ }];\n+ return nil;\n+ }\n+\n+ NSUInteger AES256KeyByteCount = 32;\n+ NSData *key = [[keyString substringToIndex:AES256KeyByteCount]\n+ dataUsingEncoding:NSUTF8StringEncoding];\n+ NSMutableData *resultBinary =\n+ [NSMutableData dataWithLength:binary.length + kCCBlockSizeAES128];\n+\n+ size_t processedBytes = 0;\n+ CCCryptorStatus ccStatus = CCCrypt(\n+ operation,\n+ kCCAlgorithmAES,\n+ kCCOptionPKCS7Padding,\n+ key.bytes,\n+ key.length,\n+ nil,\n+ binary.bytes,\n+ binary.length,\n+ resultBinary.mutableBytes,\n+ resultBinary.length,\n+ &processedBytes);\n+\n+ resultBinary.length = processedBytes;\n+ if (ccStatus != kCCSuccess) {\n+ *err = [NSError\n+ errorWithDomain:@\"app.comm\"\n+ code:ccStatus\n+ userInfo:@{\n+ NSLocalizedDescriptionKey : @\"Cryptographic operation failed\"\n+ }];\n+ return nil;\n+ }\n+ return resultBinary;\n+}\n+\n+@end\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
Implement encryption-decryption layer for elementary file operations Summary: Implements encryption-decryption layer for flat-file message store operations. Test Plan: Modify AppDelegate so that on AppLaunch it encrypts and decrypts some text then assert they are equal. Reviewers: palys-swm, varun, karol-bisztyga Reviewed By: palys-swm Subscribers: ashoat, Adrian, atul, yayabosh Differential Revision: https://phab.comm.dev/D4384
129,200
13.07.2022 14:29:30
14,400
d6ac92d9804dfa25ef1bc0d24712e156ed7d52eb
[docs] add Terraform installation instructions Summary: We should have Terraform installation instructions in the dev_services.md doc since we use Terraform scripts in our local cloud. Test Plan: followed these instructions to install Terraform Reviewers: yayabosh, ashoat Subscribers: ashoat, palys-swm, Adrian, atul
[ { "change_type": "MODIFY", "old_path": "docs/dev_services.md", "new_path": "docs/dev_services.md", "diff": "@@ -20,6 +20,10 @@ Some of our services access AWS resources via the AWS C++ SDK. To access these r\nWe recommend running `aws configure`, which will prompt you for the necessary configuration values.\n+## Terraform\n+\n+We use [Terraform](https://www.terraform.io/) to create and manage our AWS resources. Installation instructions can be found [here](https://www.terraform.io/downloads).\n+\n## RabbitMQ (Tunnelbroker only)\n[RabbitMQ](https://www.rabbitmq.com/) is an open-source message broker service. We use RabbitMQ in Tunnelbroker to facilitate communication between devices and keyservers. We use the secure AMQPS protocol to connect to RabbitMQ instances hosted on AWS.\n@@ -80,7 +84,7 @@ First, you need to initialize the local cloud using the following command from t\nyarn init-local-cloud\n```\n-This will start the LocalStack Docker image and initialize required resources, including DynamoDB tables and S3 buckets, using [Terraform](https://www.terraform.io/) scripts located in `services/terraform`.\n+This will start the LocalStack Docker image and initialize required resources, including DynamoDB tables and S3 buckets, using the Terraform scripts located in `services/terraform`.\nTo start a certain service in the sandbox you can run the following command:\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[docs] add Terraform installation instructions Summary: We should have Terraform installation instructions in the dev_services.md doc since we use Terraform scripts in our local cloud. Test Plan: followed these instructions to install Terraform Reviewers: yayabosh, ashoat Reviewed By: yayabosh, ashoat Subscribers: ashoat, palys-swm, Adrian, atul Differential Revision: https://phab.comm.dev/D4524
129,201
07.07.2022 13:53:16
-7,200
8c0a660c8382ce39663268604a54d95c0166b913
[services] Tunnelbroker - Tests for `validateUUIDv4` function Summary: This diff introduces tests for a `validateUUIDv4` function from D4467 which validate generated UUIDs. Test Plan: Expected test results on run `yarn test-tunnelbroker-service-in-sandbox`. Reviewers: karol-bisztyga, palys-swm Subscribers: ashoat, palys-swm, Adrian, atul, karol-bisztyga, yayabosh
[ { "change_type": "MODIFY", "old_path": "services/tunnelbroker/test/ToolsTest.cpp", "new_path": "services/tunnelbroker/test/ToolsTest.cpp", "diff": "@@ -34,6 +34,31 @@ TEST(ToolsTest, ValidateDeviceIDReturnsTrueOnGeneratedValidDeviceID) {\n<< \"\\\" is invalid by the function\";\n}\n+TEST(ToolsTest, ValidateUUIDv4ReturnsTrueOnStaticValidUUID) {\n+ const std::string validUUID = \"9bfdd6ea-25de-418f-aa2e-869c78073d81\";\n+ EXPECT_EQ(tools::validateUUIDv4(validUUID), true)\n+ << \"Valid UUID \\\"\" << validUUID << \"\\\" is invalid by the function\";\n+}\n+\n+TEST(ToolsTest, ValidateUUIDv4ReturnsTrueOnGeneratedValidUUID) {\n+ const std::string validUUID = tools::generateUUID();\n+ EXPECT_EQ(tools::validateUUIDv4(validUUID), true)\n+ << \"Valid generated UUID \\\"\" << validUUID\n+ << \"\\\" is invalid by the function\";\n+}\n+\n+TEST(ToolsTest, ValidateUUIDv4ReturnsFalseOnStaticInvalidUUID) {\n+ const std::string invalidFormatUUID = \"58g8141b-8e5b-48f4-b3a1-e5e495c65f93\";\n+ EXPECT_EQ(tools::validateUUIDv4(invalidFormatUUID), false)\n+ << \"Invalid formatted UUID \\\"\" << invalidFormatUUID\n+ << \"\\\" is valid by the function\";\n+ const std::string uppercaseUUID = \"58F8141B-8E5B-48F4-B3A1-E5E495C65F93\";\n+ EXPECT_EQ(tools::validateUUIDv4(uppercaseUUID), false)\n+ << \"Uppercase UUID \\\"\" << uppercaseUUID\n+ << \"\\\" must be invalid because we are using the lowercase UUID format \"\n+ \"convention\";\n+}\n+\nTEST(ToolsTest, ValidateDeviceIDReturnsFalseOnInvalidDeviceIDPrefix) {\nconst std::string invalidDeviceIDPrefix =\n\"invalid-\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Tunnelbroker - Tests for `validateUUIDv4` function Summary: This diff introduces tests for a `validateUUIDv4` function from D4467 which validate generated UUIDs. Test Plan: Expected test results on run `yarn test-tunnelbroker-service-in-sandbox`. Reviewers: karol-bisztyga, palys-swm Reviewed By: karol-bisztyga, palys-swm Subscribers: ashoat, palys-swm, Adrian, atul, karol-bisztyga, yayabosh Differential Revision: https://phab.comm.dev/D4468
129,187
13.07.2022 10:05:22
14,400
e42b5ff5959467bb5387c724e3f0bdcb788289f4
[keyserver] Rename COMM_MYSQL env variables to COMM_DATABASE Summary: See feedback [here](https://phab.comm.dev/D4499?id=14398#inline-28206). Test Plan: I `git grep` for each variable name to make sure the spelling was correct, and I made sure the number of results matched my expectations Reviewers: jonringer-comm, atul, palys-swm Subscribers: Adrian, yayabosh
[ { "change_type": "MODIFY", "old_path": "keyserver/docker-compose.yml", "new_path": "keyserver/docker-compose.yml", "diff": "@@ -16,10 +16,10 @@ services:\nenvironment:\n- REDIS_URL=redis://cache\n- COMM_LISTEN_ADDR=0.0.0.0\n- - COMM_MYSQL_HOST=${COMM_MYSQL_HOST:-database}\n- - COMM_MYSQL_DATABASE\n- - COMM_MYSQL_USER\n- - COMM_MYSQL_PASSWORD\n+ - COMM_DATABASE_HOST=${COMM_DATABASE_HOST:-database}\n+ - COMM_DATABASE_DATABASE\n+ - COMM_DATABASE_USER\n+ - COMM_DATABASE_PASSWORD\ndepends_on:\n- cache\n- database\n@@ -39,9 +39,9 @@ services:\n--innodb-buffer-pool-size=1600M\nenvironment:\n- MYSQL_RANDOM_ROOT_PASSWORD=yes\n- - MYSQL_DATABASE=$COMM_MYSQL_DATABASE\n- - MYSQL_USER=$COMM_MYSQL_USER\n- - MYSQL_PASSWORD=$COMM_MYSQL_PASSWORD\n+ - MYSQL_DATABASE=$COMM_DATABASE_DATABASE\n+ - MYSQL_USER=$COMM_DATABASE_USER\n+ - MYSQL_PASSWORD=$COMM_DATABASE_PASSWORD\nvolumes:\n- mysqldata:/var/lib/mysql\ncache:\n" }, { "change_type": "MODIFY", "old_path": "keyserver/src/database/db-config.js", "new_path": "keyserver/src/database/db-config.js", "diff": "@@ -17,15 +17,15 @@ async function getDBConfig(): Promise<DBConfig> {\nreturn dbConfig;\n}\nif (\n- process.env.COMM_MYSQL_DATABASE &&\n- process.env.COMM_MYSQL_USER &&\n- process.env.COMM_MYSQL_PASSWORD\n+ process.env.COMM_DATABASE_DATABASE &&\n+ process.env.COMM_DATABASE_USER &&\n+ process.env.COMM_DATABASE_PASSWORD\n) {\ndbConfig = {\n- host: process.env.COMM_MYSQL_HOST || 'localhost',\n- user: process.env.COMM_MYSQL_USER,\n- password: process.env.COMM_MYSQL_PASSWORD,\n- database: process.env.COMM_MYSQL_DATABASE,\n+ host: process.env.COMM_DATABASE_HOST || 'localhost',\n+ user: process.env.COMM_DATABASE_USER,\n+ password: process.env.COMM_DATABASE_PASSWORD,\n+ database: process.env.COMM_DATABASE_DATABASE,\n};\n} else {\nconst importedDBConfig = await importJSON({\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[keyserver] Rename COMM_MYSQL env variables to COMM_DATABASE Summary: See feedback [here](https://phab.comm.dev/D4499?id=14398#inline-28206). Test Plan: I `git grep` for each variable name to make sure the spelling was correct, and I made sure the number of results matched my expectations Reviewers: jonringer-comm, atul, palys-swm Reviewed By: jonringer-comm Subscribers: Adrian, yayabosh Differential Revision: https://phab.comm.dev/D4515
129,187
13.07.2022 11:39:52
14,400
e2cb36c1a0d9a9a1f6373b6739c1c3b9da34e564
[keyserver] Introduce getDBType function to distinguish MySQL and MariaDB Summary: Depends on D4516 Test Plan: Tested in combination with next diffs Reviewers: jonringer-comm, atul, palys-swm Subscribers: Adrian, yayabosh
[ { "change_type": "MODIFY", "old_path": "keyserver/src/database/db-config.js", "new_path": "keyserver/src/database/db-config.js", "diff": "@@ -4,12 +4,13 @@ import invariant from 'invariant';\nimport { importJSON } from '../utils/import-json';\n+type DBType = 'mysql5.7' | 'mariadb10.8';\nexport type DBConfig = {\n+host: string,\n+user: string,\n+password: string,\n+database: string,\n- +dbType: 'mysql5.7' | 'mariadb10.8',\n+ +dbType: DBType,\n};\nlet dbConfig;\n@@ -47,4 +48,9 @@ async function getDBConfig(): Promise<DBConfig> {\nreturn dbConfig;\n}\n-export { getDBConfig };\n+async function getDBType(): Promise<DBType> {\n+ const config = await getDBConfig();\n+ return config.dbType;\n+}\n+\n+export { getDBConfig, getDBType };\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[keyserver] Introduce getDBType function to distinguish MySQL and MariaDB Summary: Depends on D4516 Test Plan: Tested in combination with next diffs Reviewers: jonringer-comm, atul, palys-swm Reviewed By: atul Subscribers: Adrian, yayabosh Differential Revision: https://phab.comm.dev/D4518
129,182
19.07.2022 12:22:16
-7,200
40369c86934fff534bdfacdf765abf1973b28c1a
[lib,keyserver] Rename thread to chat Summary: Linear issue: Diff renames thread to chat in all strings displayed to the user in keyserver and lib Test Plan: Checked if strings changed as expected in web or mobile. Reviewers: palys-swm, ashoat, def-au1t Subscribers: Adrian, atul, yayabosh
[ { "change_type": "MODIFY", "old_path": "keyserver/src/creators/thread-creator.js", "new_path": "keyserver/src/creators/thread-creator.js", "diff": "@@ -52,7 +52,7 @@ import type { UpdatesForCurrentSession } from './update-creator';\nconst { commbot } = bots;\nconst privateThreadDescription: string =\n- 'This is your private thread, ' +\n+ 'This is your private chat, ' +\n'where you can set reminders and jot notes in private!';\ntype CreateThreadOptions = Shape<{\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/change-settings-message-spec.js", "new_path": "lib/shared/messages/change-settings-message-spec.js", "diff": "@@ -132,7 +132,7 @@ export const changeSettingsMessageSpec: MessageSpec<\n) {\nreturn `${creator} cleared ${params.encodedThreadEntity(\nmessageInfo.threadID,\n- 'the thread',\n+ 'the chat',\n)}'s ${messageInfo.field}`;\n}\nlet value;\n@@ -153,7 +153,7 @@ export const changeSettingsMessageSpec: MessageSpec<\n}\nreturn (\n`${creator} updated ` +\n- `${params.encodedThreadEntity(messageInfo.threadID, 'the thread')}'s ` +\n+ `${params.encodedThreadEntity(messageInfo.threadID, 'the chat')}'s ` +\n`${messageInfo.field} to \"${value}\"`\n);\n},\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/create-sub-thread-message-spec.js", "new_path": "lib/shared/messages/create-sub-thread-message-spec.js", "diff": "@@ -126,7 +126,7 @@ export const createSubThreadMessageSpec: MessageSpec<\nconst childNoun =\nmessageInfo.childThreadInfo.type === threadTypes.SIDEBAR\n? 'sidebar'\n- : 'child thread';\n+ : 'subchannel';\nif (childName) {\nreturn (\n`${creator} created a ${childNoun}` +\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/create-thread-message-spec.js", "new_path": "lib/shared/messages/create-thread-message-spec.js", "diff": "@@ -147,7 +147,7 @@ export const createThreadMessageSpec: MessageSpec<\n): string {\nlet text = `created ${params.encodedThreadEntity(\nmessageInfo.threadID,\n- `this thread`,\n+ `this chat`,\n)}`;\nconst parentThread = messageInfo.initialThreadState.parentThreadInfo;\nif (parentThread) {\n@@ -189,7 +189,7 @@ export const createThreadMessageSpec: MessageSpec<\n);\n}\nconst prefix = stringForUser(messageInfo.creator);\n- const body = 'created a new thread';\n+ const body = 'created a new chat';\nlet merged = `${prefix} ${body}`;\nif (messageInfo.initialThreadState.name) {\nmerged += ` called \"${messageInfo.initialThreadState.name}\"`;\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/join-thread-message-spec.js", "new_path": "lib/shared/messages/join-thread-message-spec.js", "diff": "@@ -101,7 +101,7 @@ export const joinThreadMessageSpec: MessageSpec<\n): string {\nreturn (\n`${creator} joined ` +\n- params.encodedThreadEntity(messageInfo.threadID, 'this thread')\n+ params.encodedThreadEntity(messageInfo.threadID, 'this chat')\n);\n},\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/messages/leave-thread-message-spec.js", "new_path": "lib/shared/messages/leave-thread-message-spec.js", "diff": "@@ -101,7 +101,7 @@ export const leaveThreadMessageSpec: MessageSpec<\n): string {\nreturn (\n`${creator} left ` +\n- params.encodedThreadEntity(messageInfo.threadID, 'this thread')\n+ params.encodedThreadEntity(messageInfo.threadID, 'this chat')\n);\n},\n" }, { "change_type": "MODIFY", "old_path": "lib/shared/notif-utils.js", "new_path": "lib/shared/notif-utils.js", "diff": "@@ -60,7 +60,7 @@ function notifThreadName(threadInfo: ThreadInfo): string {\nif (threadInfo.name) {\nreturn threadInfo.name;\n} else {\n- return 'your thread';\n+ return 'your chat';\n}\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib,keyserver] Rename thread to chat Summary: Linear issue: https://linear.app/comm/issue/ENG-1357/rename-sidebar-to-thread-in-product-copy Diff renames thread to chat in all strings displayed to the user in keyserver and lib Test Plan: Checked if strings changed as expected in web or mobile. Reviewers: palys-swm, ashoat, def-au1t Reviewed By: ashoat Subscribers: Adrian, atul, yayabosh Differential Revision: https://phab.comm.dev/D4536
129,182
19.07.2022 12:22:16
-7,200
9e4270d1e5260e848dd41c0729aff7249e6f82c9
[native] Rename thread to chat Summary: Linear issue: Diff renames thread to chat in all strings displayed to the user in native Test Plan: Checked if strings changed as expected in web or mobile. Reviewers: palys-swm, ashoat, def-au1t Subscribers: Adrian, atul, yayabosh
[ { "change_type": "MODIFY", "old_path": "native/chat/chat-input-bar.react.js", "new_path": "native/chat/chat-input-bar.react.js", "diff": "@@ -428,7 +428,7 @@ class ChatInputBar extends React.PureComponent<Props, State> {\nname=\"plus\"\nstyle={this.props.styles.joinButtonText}\n/>\n- <Text style={this.props.styles.joinButtonText}>Join Thread</Text>\n+ <Text style={this.props.styles.joinButtonText}>Join Chat</Text>\n</View>\n);\n}\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat-thread-list.react.js", "new_path": "native/chat/chat-thread-list.react.js", "diff": "@@ -298,7 +298,7 @@ class ChatThreadList extends React.PureComponent<Props, State> {\nonChangeText={this.onChangeSearchText}\ncontainerStyle={this.props.styles.search}\nonBlur={this.onSearchBlur}\n- placeholder=\"Search threads\"\n+ placeholder=\"Search chats\"\nref={this.searchInputRef}\n{...additionalProps}\n/>\n" }, { "change_type": "MODIFY", "old_path": "native/chat/chat.react.js", "new_path": "native/chat/chat.react.js", "diff": "@@ -220,7 +220,7 @@ const messageListOptions = ({ navigation, route }) => ({\nheaderBackTitleVisible: false,\n});\nconst composeThreadOptions = {\n- headerTitle: 'Compose thread',\n+ headerTitle: 'Compose chat',\nheaderBackTitleVisible: false,\n};\nconst threadSettingsOptions = ({ route }) => ({\n@@ -228,7 +228,7 @@ const threadSettingsOptions = ({ route }) => ({\nheaderBackTitleVisible: false,\n});\nconst deleteThreadOptions = {\n- headerTitle: 'Delete thread',\n+ headerTitle: 'Delete chat',\nheaderBackTitleVisible: false,\n};\n" }, { "change_type": "MODIFY", "old_path": "native/chat/compose-subchannel.react.js", "new_path": "native/chat/compose-subchannel.react.js", "diff": "@@ -218,7 +218,7 @@ class ComposeSubchannel extends React.PureComponent<Props, State> {\n<View style={this.props.styles.existingThreads}>\n<View style={this.props.styles.existingThreadsRow}>\n<Text style={this.props.styles.existingThreadsLabel}>\n- Existing threads\n+ Existing channels\n</Text>\n</View>\n<View style={this.props.styles.existingThreadList}>\n@@ -305,7 +305,7 @@ class ComposeSubchannel extends React.PureComponent<Props, State> {\nif (this.state.userInfoInputArray.length === 0) {\nAlert.alert(\n'Chatting to yourself?',\n- 'Are you sure you want to create a thread containing only yourself?',\n+ 'Are you sure you want to create a channel containing only yourself?',\n[\n{ text: 'Cancel', style: 'cancel' },\n{ text: 'Confirm', onPress: this.dispatchNewChatThreadAction },\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/compose-subchannel-modal.react.js", "new_path": "native/chat/settings/compose-subchannel-modal.react.js", "diff": "@@ -33,7 +33,7 @@ class ComposeSubchannelModal extends React.PureComponent<Props> {\nrender() {\nreturn (\n<Modal modalStyle={this.props.styles.modal}>\n- <Text style={this.props.styles.visibility}>Thread type</Text>\n+ <Text style={this.props.styles.visibility}>Chat type</Text>\n<Button style={this.props.styles.option} onPress={this.onPressOpen}>\n<SWMansionIcon\nname=\"globe-1\"\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/delete-thread.react.js", "new_path": "native/chat/settings/delete-thread.react.js", "diff": "@@ -110,7 +110,7 @@ class DeleteThread extends React.PureComponent<Props, State> {\nthis.props.loadingStatus === 'loading' ? (\n<ActivityIndicator size=\"small\" color=\"white\" />\n) : (\n- <Text style={this.props.styles.deleteText}>Delete thread</Text>\n+ <Text style={this.props.styles.deleteText}>Delete chat</Text>\n);\nconst threadInfo = DeleteThread.getThreadInfo(this.props);\nconst { panelForegroundTertiaryLabel } = this.props.colors;\n@@ -121,7 +121,7 @@ class DeleteThread extends React.PureComponent<Props, State> {\n>\n<View>\n<Text style={this.props.styles.warningText}>\n- {`The thread \"${threadInfo.uiName}\" will be permanently deleted. `}\n+ {`The chat \"${threadInfo.uiName}\" will be permanently deleted. `}\nThere is no way to reverse this.\n</Text>\n</View>\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/thread-settings-delete-thread.react.js", "new_path": "native/chat/settings/thread-settings-delete-thread.react.js", "diff": "@@ -38,7 +38,7 @@ function ThreadSettingsDeleteThread(props: Props): React.Node {\niosFormat=\"highlight\"\niosHighlightUnderlayColor={panelIosHighlightUnderlay}\n>\n- <Text style={styles.text}>Delete thread...</Text>\n+ <Text style={styles.text}>Delete chat...</Text>\n</Button>\n</View>\n);\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/thread-settings-leave-thread.react.js", "new_path": "native/chat/settings/thread-settings-leave-thread.react.js", "diff": "@@ -65,7 +65,7 @@ class ThreadSettingsLeaveThread extends React.PureComponent<Props> {\niosFormat=\"highlight\"\niosHighlightUnderlayColor={panelIosHighlightUnderlay}\n>\n- <Text style={this.props.styles.text}>Leave thread...</Text>\n+ <Text style={this.props.styles.text}>Leave chat...</Text>\n{loadingIndicator}\n</Button>\n</View>\n@@ -85,7 +85,7 @@ class ThreadSettingsLeaveThread extends React.PureComponent<Props> {\nAlert.alert(\n'Confirm action',\n- 'Are you sure you want to leave this thread?',\n+ 'Are you sure you want to leave this chat?',\n[\n{ text: 'Cancel', style: 'cancel' },\n{ text: 'OK', onPress: this.onConfirmLeaveThread },\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/thread-settings-member-tooltip-modal.react.js", "new_path": "native/chat/settings/thread-settings-member-tooltip-modal.react.js", "diff": "@@ -47,7 +47,7 @@ function onRemoveUser(\nconst userText = stringForUser(memberInfo);\nAlert.alert(\n'Confirm removal',\n- `Are you sure you want to remove ${userText} from this thread?`,\n+ `Are you sure you want to remove ${userText} from this chat?`,\n[\n{ text: 'Cancel', style: 'cancel' },\n{ text: 'OK', onPress: onConfirmRemoveUser },\n@@ -79,7 +79,7 @@ function onToggleAdmin(\n: `make ${userText} an admin`;\nAlert.alert(\n'Confirm action',\n- `Are you sure you want to ${actionClause} of this thread?`,\n+ `Are you sure you want to ${actionClause} of this chat?`,\n[\n{ text: 'Cancel', style: 'cancel' },\n{ text: 'OK', onPress: onConfirmMakeAdmin },\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/thread-settings-promote-sidebar.react.js", "new_path": "native/chat/settings/thread-settings-promote-sidebar.react.js", "diff": "@@ -26,7 +26,7 @@ class ThreadSettingsPromoteSidebar extends React.PureComponent<Props> {\nonClick = () => {\nAlert.alert(\n'Are you sure?',\n- 'Promoting a sidebar to a full thread cannot be undone.',\n+ 'Promoting a sidebar to a channel cannot be undone.',\n[\n{\ntext: 'Cancel',\n@@ -58,7 +58,7 @@ class ThreadSettingsPromoteSidebar extends React.PureComponent<Props> {\niosFormat=\"highlight\"\niosHighlightUnderlayColor={panelIosHighlightUnderlay}\n>\n- <Text style={this.props.styles.text}>Promote to full thread</Text>\n+ <Text style={this.props.styles.text}>Promote to channel</Text>\n{loadingIndicator}\n</Button>\n</View>\n" }, { "change_type": "MODIFY", "old_path": "native/chat/thread-screen-pruner.react.js", "new_path": "native/chat/thread-screen-pruner.react.js", "diff": "@@ -65,8 +65,8 @@ const ThreadScreenPruner: React.ComponentType<{}> = React.memo<{}>(\n}\nif (activeThreadID && pruneThreadIDs.includes(activeThreadID)) {\nAlert.alert(\n- 'Thread invalidated',\n- 'You no longer have permission to view this thread :(',\n+ 'Chat invalidated',\n+ 'You no longer have permission to view this chat :(',\n[{ text: 'OK' }],\n{ cancelable: true },\n);\n" }, { "change_type": "MODIFY", "old_path": "native/components/color-selector.react.js", "new_path": "native/components/color-selector.react.js", "diff": "@@ -58,7 +58,7 @@ function ColorSelector(props: ColorSelectorProps): React.Node {\nreturn (\n<View style={styles.container}>\n- <Text style={styles.header}>Select thread color</Text>\n+ <Text style={styles.header}>Select chat color</Text>\n<View style={styles.colorButtons}>{firstRow}</View>\n<View style={styles.colorButtons}>{secondRow}</View>\n<TouchableOpacity\n" }, { "change_type": "MODIFY", "old_path": "native/components/thread-list.react.js", "new_path": "native/components/thread-list.react.js", "diff": "@@ -73,7 +73,7 @@ class ThreadList extends React.PureComponent<Props, State> {\nsearchText={this.state.searchText}\nonChangeText={this.onChangeSearchText}\ncontainerStyle={this.props.styles.search}\n- placeholder=\"Search threads\"\n+ placeholder=\"Search chats\"\nref={this.searchRef}\n/>\n);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Rename thread to chat Summary: Linear issue: https://linear.app/comm/issue/ENG-1357/rename-sidebar-to-thread-in-product-copy Diff renames thread to chat in all strings displayed to the user in native Test Plan: Checked if strings changed as expected in web or mobile. Reviewers: palys-swm, ashoat, def-au1t Reviewed By: ashoat Subscribers: Adrian, atul, yayabosh Differential Revision: https://phab.comm.dev/D4538
129,182
19.07.2022 12:22:16
-7,200
4c883c8ccb46d9ce91e32ec5caa563690c8e9bc9
[web] Rename thread to chat Summary: Linear issue: Diff renames thread to chat in all strings displayed to the user in web Test Plan: Checked if strings changed as expected in web. Reviewers: palys-swm, ashoat, def-au1t, yayabosh Subscribers: Adrian, atul, yayabosh
[ { "change_type": "MODIFY", "old_path": "web/calendar/filter-panel.react.js", "new_path": "web/calendar/filter-panel.react.js", "diff": "@@ -326,9 +326,7 @@ class Category extends React.PureComponent<CategoryProps> {\n}\nconst icon = this.props.collapsed ? faChevronUp : faChevronDown;\nconst details =\n- this.props.numThreads === 1\n- ? '1 thread'\n- : `${this.props.numThreads} threads`;\n+ this.props.numThreads === 1 ? '1 chat' : `${this.props.numThreads} chats`;\nreturn (\n<div className={css.category}>\n<div className={css.optionThread}>\n@@ -339,7 +337,7 @@ class Category extends React.PureComponent<CategoryProps> {\n/>\n<label>\n<div className={css.optionCheckbox} style={beforeCheckStyles} />\n- Your threads\n+ Your chats\n{afterCheck}\n</label>\n<a onClick={this.onCollapse} className={css.collapse}>\n" }, { "change_type": "MODIFY", "old_path": "web/chat/chat-input-bar.react.js", "new_path": "web/chat/chat-input-bar.react.js", "diff": "@@ -179,7 +179,7 @@ class ChatInputBar extends React.PureComponent<Props> {\nbuttonContent = (\n<>\n<SWMansionIcon icon=\"plus\" size={24} />\n- <p className={css.joinButtonText}>Join Thread</p>\n+ <p className={css.joinButtonText}>Join Chat</p>\n</>\n);\n}\n" }, { "change_type": "MODIFY", "old_path": "web/chat/chat-thread-list.react.js", "new_path": "web/chat/chat-thread-list.react.js", "diff": "@@ -40,7 +40,7 @@ function ChatThreadList(): React.Node {\n<Search\nonChangeText={setSearchText}\nsearchText={searchText}\n- placeholder=\"Search threads\"\n+ placeholder=\"Search chats\"\n/>\n<div>{threadComponents}</div>\n</div>\n" }, { "change_type": "MODIFY", "old_path": "web/chat/thread-menu.react.js", "new_path": "web/chat/thread-menu.react.js", "diff": "@@ -190,7 +190,7 @@ function ThreadMenu(props: ThreadMenuProps): React.Node {\nreturn (\n<MenuItem\nkey=\"leave\"\n- text=\"Leave Thread\"\n+ text=\"Leave Chat\"\nicon=\"logout\"\ndangerous\nonClick={onClickLeaveThread}\n@@ -214,7 +214,7 @@ function ThreadMenu(props: ThreadMenuProps): React.Node {\nreturn (\n<MenuItem\nkey=\"promote\"\n- text=\"Promote Thread\"\n+ text=\"Promote to channel\"\nicon=\"message-square-lines\"\nonClick={onClickPromoteSidebarToThread}\n/>\n" }, { "change_type": "MODIFY", "old_path": "web/modals/chat/sidebar-promote-modal.react.js", "new_path": "web/modals/chat/sidebar-promote-modal.react.js", "diff": "@@ -26,19 +26,19 @@ function SidebarPromoteModal(props: Props): React.Node {\nreturn (\n<Modal\nsize=\"large\"\n- name=\"Promote Thread\"\n+ name=\"Promote to channel\"\nicon=\"warning-circle\"\nonClose={onClose}\n>\n<div className={css.modal_body}>\n<p>{`Are you sure you want to promote \"${uiName}\"?`}</p>\n- <p>Promoting a sidebar to a full thread cannot be undone.</p>\n+ <p>Promoting a sidebar to a channel cannot be undone.</p>\n<div className={css.buttonContainer}>\n<Button onClick={onClose} type=\"submit\" variant=\"secondary\">\nCancel\n</Button>\n<Button onClick={handleConfirm} type=\"submit\" variant=\"danger\">\n- Promote to Full Thread\n+ Promote to channel\n</Button>\n</div>\n</div>\n" }, { "change_type": "MODIFY", "old_path": "web/modals/threads/cant-leave-thread-modal.react.js", "new_path": "web/modals/threads/cant-leave-thread-modal.react.js", "diff": "@@ -11,11 +11,11 @@ type Props = {\n};\nfunction CantLeaveThreadModal(props: Props): React.Node {\nreturn (\n- <Modal name=\"Cannot leave thread\" onClose={props.onClose}>\n+ <Modal name=\"Cannot leave chat\" onClose={props.onClose}>\n<div className={css.modal_body}>\n<p>\n- You are the only admin left of this thread. Please promote somebody\n- else to admin before leaving.\n+ You are the only admin left of this chat. Please promote somebody else\n+ to admin before leaving.\n</p>\n<Button\nonClick={props.onClose}\n" }, { "change_type": "MODIFY", "old_path": "web/modals/threads/confirm-leave-thread-modal.react.js", "new_path": "web/modals/threads/confirm-leave-thread-modal.react.js", "diff": "@@ -36,7 +36,7 @@ function ConfirmLeaveThreadModal(props: Props): React.Node {\nCancel\n</Button>\n<Button variant=\"danger\" onClick={onConfirm} type=\"submit\">\n- Yes, leave Thread\n+ Yes, leave chat\n</Button>\n</div>\n</div>\n" }, { "change_type": "MODIFY", "old_path": "web/modals/threads/members/members-list.react.js", "new_path": "web/modals/threads/members/members-list.react.js", "diff": "@@ -63,7 +63,7 @@ function ThreadMembersList(props: Props): React.Node {\nif (!hasMembers) {\ncontent = (\n<div className={css.noUsers}>\n- No matching users were found in the thread!\n+ No matching users were found in the chat!\n</div>\n);\n}\n" }, { "change_type": "MODIFY", "old_path": "web/modals/threads/new-thread-modal.react.js", "new_path": "web/modals/threads/new-thread-modal.react.js", "diff": "@@ -84,7 +84,7 @@ class NewThreadModal extends React.PureComponent<Props, State> {\nthreadTypeSection = (\n<div className={css['new-thread-privacy-container']}>\n<div className={css['modal-radio-selector']}>\n- <div className={css['form-title']}>Thread type</div>\n+ <div className={css['form-title']}>Chat type</div>\n<div className={css['form-enum-selector']}>\n<div className={css['form-enum-container']}>\n<input\n@@ -131,16 +131,16 @@ class NewThreadModal extends React.PureComponent<Props, State> {\n);\n}\nreturn (\n- <Modal name=\"New thread\" onClose={this.props.onClose} size=\"large\">\n+ <Modal name=\"New chat\" onClose={this.props.onClose} size=\"large\">\n<div className={css['modal-body']}>\n<form method=\"POST\">\n<div>\n- <div className={css['form-title']}>Thread name</div>\n+ <div className={css['form-title']}>Chat name</div>\n<div className={css['form-content']}>\n<input\ntype=\"text\"\nvalue={firstLine(this.state.name)}\n- placeholder=\"Thread name\"\n+ placeholder=\"Chat name\"\nonChange={this.onChangeName}\ndisabled={this.props.inputDisabled}\nref={this.nameInputRef}\n@@ -152,7 +152,7 @@ class NewThreadModal extends React.PureComponent<Props, State> {\n<div className={css['form-content']}>\n<textarea\nvalue={this.state.description}\n- placeholder=\"Thread description\"\n+ placeholder=\"Chat description\"\nonChange={this.onChangeDescription}\ndisabled={this.props.inputDisabled}\n/>\n@@ -233,7 +233,7 @@ class NewThreadModal extends React.PureComponent<Props, State> {\nif (threadType === undefined) {\nthis.setState(\n{\n- errorMessage: 'thread type unspecified',\n+ errorMessage: 'chat type unspecified',\n},\n() => {\ninvariant(this.openPrivacyInput, 'openPrivacyInput ref unset');\n@@ -257,7 +257,7 @@ class NewThreadModal extends React.PureComponent<Props, State> {\nthreadType === 4 ||\nthreadType === 6 ||\nthreadType === 7,\n- \"Sidebars and communities can't be created from the thread composer\",\n+ \"Sidebars and communities can't be created from the chat composer\",\n);\nconst query = this.props.calendarQuery();\nconst response = await this.props.newThread({\n@@ -296,10 +296,7 @@ const ConnectedNewThreadModal: React.ComponentType<BaseProps> = React.memo<BaseP\nconst parentThreadInfo: ?ThreadInfo = useSelector(state =>\nparentThreadID ? threadInfoSelector(state)[parentThreadID] : null,\n);\n- invariant(\n- !parentThreadID || parentThreadInfo,\n- 'parent thread should exist',\n- );\n+ invariant(!parentThreadID || parentThreadInfo, 'parent chat should exist');\nconst inputDisabled = useSelector(loadingStatusSelector) === 'loading';\nconst calendarQuery = useSelector(nonThreadCalendarQuery);\nconst callNewThread = useServerCall(newThread);\n" }, { "change_type": "MODIFY", "old_path": "web/modals/threads/settings/thread-settings-delete-tab.react.js", "new_path": "web/modals/threads/settings/thread-settings-delete-tab.react.js", "diff": "@@ -87,7 +87,7 @@ function ThreadSettingsDeleteTab(\n<div>\n<SWMansionIcon icon=\"warning-circle\" size={22} />\n<p className={css.deletion_warning}>\n- Your thread will be permanently deleted. There is no way to reverse\n+ Your chat will be permanently deleted. There is no way to reverse\nthis.\n</p>\n</div>\n" }, { "change_type": "MODIFY", "old_path": "web/modals/threads/settings/thread-settings-general-tab.react.js", "new_path": "web/modals/threads/settings/thread-settings-general-tab.react.js", "diff": "@@ -147,7 +147,7 @@ function ThreadSettingsGeneralTab(\nreturn (\n<form method=\"POST\">\n<div>\n- <div className={css.form_title}>Thread name</div>\n+ <div className={css.form_title}>Chat name</div>\n<div className={css.form_content}>\n<Input\ntype=\"text\"\n@@ -166,7 +166,7 @@ function ThreadSettingsGeneralTab(\n<div className={css.form_content}>\n<textarea\nvalue={queuedChanges.description ?? threadInfo.description ?? ''}\n- placeholder=\"Thread description\"\n+ placeholder=\"Chat description\"\nonChange={onChangeDescription}\ndisabled={threadSettingsOperationInProgress}\nrows={3}\n" }, { "change_type": "MODIFY", "old_path": "web/modals/threads/settings/thread-settings-modal.react.js", "new_path": "web/modals/threads/settings/thread-settings-modal.react.js", "diff": "@@ -102,9 +102,9 @@ const ConnectedThreadSettingsModal: React.ComponentType<BaseProps> = React.memo<\nif (!threadInfo) {\nreturn (\n- <Modal onClose={modalContext.popModal} name=\"Invalid thread\">\n+ <Modal onClose={modalContext.popModal} name=\"Invalid chat\">\n<div className={css.modal_body}>\n- <p>You no longer have permission to view this thread</p>\n+ <p>You no longer have permission to view this chat</p>\n</div>\n</Modal>\n);\n@@ -170,7 +170,7 @@ const ConnectedThreadSettingsModal: React.ComponentType<BaseProps> = React.memo<\nreturn (\n<Modal\n- name=\"Thread settings\"\n+ name=\"Chat settings\"\nonClose={modalContext.popModal}\nicon=\"settings\"\n>\n" }, { "change_type": "MODIFY", "old_path": "web/modals/threads/settings/thread-settings-privacy-tab.react.js", "new_path": "web/modals/threads/settings/thread-settings-privacy-tab.react.js", "diff": "@@ -139,7 +139,7 @@ function ThreadSettingsPrivacyTab(\nreturn (\n<form method=\"POST\">\n- <div className={css.form_title}>Thread type</div>\n+ <div className={css.form_title}>Chat type</div>\n<div className={css.enum_container}>\n<EnumSettingsOption\nselected={\n" }, { "change_type": "MODIFY", "old_path": "web/modals/threads/subchannels/subchannels-modal.react.js", "new_path": "web/modals/threads/subchannels/subchannels-modal.react.js", "diff": "@@ -113,7 +113,7 @@ function SubchannelsModalContent(props: ContentProps): React.Node {\nif (!filteredSubchannelsChatList.length) {\nreturn (\n<div className={css.noSubchannels}>\n- No matching subchannels were found in the thread!\n+ No matching subchannels were found in the channel!\n</div>\n);\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] Rename thread to chat Summary: Linear issue: https://linear.app/comm/issue/ENG-1357/rename-sidebar-to-thread-in-product-copy Diff renames thread to chat in all strings displayed to the user in web Test Plan: Checked if strings changed as expected in web. Reviewers: palys-swm, ashoat, def-au1t, yayabosh Reviewed By: ashoat, yayabosh Subscribers: Adrian, atul, yayabosh Differential Revision: https://phab.comm.dev/D4539
129,200
13.07.2022 14:41:27
14,400
6912b58e7f20541fe7fbead79fac54c2dec4639a
[services] add dynamodb tables for identity service to terraform Summary: These tables already exist in DynamoDB but they should still be added here so we can manage them with Terraform. Test Plan: ran `terraform validate` Reviewers: geekbrother, palys-swm, karol-bisztyga Subscribers: ashoat, Adrian, atul, yayabosh
[ { "change_type": "MODIFY", "old_path": "services/terraform/dynamodb.tf", "new_path": "services/terraform/dynamodb.tf", "diff": "@@ -161,3 +161,33 @@ resource \"aws_dynamodb_table\" \"tunnelbroker-messages\" {\nenabled = true\n}\n}\n+\n+resource \"aws_dynamodb_table\" \"identity-users\" {\n+ name = \"identity-users\"\n+ hash_key = \"userID\"\n+ write_capacity = 10\n+ read_capacity = 10\n+\n+ attribute {\n+ name = \"userID\"\n+ type = \"S\"\n+ }\n+}\n+\n+resource \"aws_dynamodb_table\" \"identity-tokens\" {\n+ name = \"identity-tokens\"\n+ hash_key = \"userID\"\n+ range_key = \"deviceID\"\n+ write_capacity = 10\n+ read_capacity = 10\n+\n+ attribute {\n+ name = \"userID\"\n+ type = \"S\"\n+ }\n+\n+ attribute {\n+ name = \"deviceID\"\n+ type = \"S\"\n+ }\n+}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] add dynamodb tables for identity service to terraform Summary: These tables already exist in DynamoDB but they should still be added here so we can manage them with Terraform. Test Plan: ran `terraform validate` Reviewers: geekbrother, palys-swm, karol-bisztyga Reviewed By: geekbrother, palys-swm Subscribers: ashoat, Adrian, atul, yayabosh Differential Revision: https://phab.comm.dev/D4525
129,184
19.07.2022 15:17:04
14,400
b35ec303de6cf4dcc79c55491212cf96c9cd65d9
[native] `codeVersion` -> 137
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -434,8 +434,8 @@ android {\napplicationId 'app.comm.android'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 136\n- versionName '1.0.136'\n+ versionCode 137\n+ versionName '1.0.137'\nmissingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "new_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "diff": "@@ -13,7 +13,7 @@ namespace comm {\nnamespace jsi = facebook::jsi;\nclass CommCoreModule : public facebook::react::CommCoreModuleSchemaCxxSpecJSI {\n- const int codeVersion{136};\n+ const int codeVersion{137};\nstd::unique_ptr<WorkerThread> databaseThread;\nstd::unique_ptr<WorkerThread> cryptoThread;\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.debug.plist", "new_path": "native/ios/Comm/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.136</string>\n+ <string>1.0.137</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>136</string>\n+ <string>137</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.release.plist", "new_path": "native/ios/Comm/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.136</string>\n+ <string>1.0.137</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>136</string>\n+ <string>137</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] `codeVersion` -> 137
129,190
21.07.2022 15:03:20
-7,200
04748179453f85243d8b88d9e8ea4acfacfa25ea
[services] Tests - Run formatter Summary: Depends on D4555 Running rust formater on the tests. Test Plan: None really, it's just code styling, the code compiles and runs as before. Reviewers: tomek, varun Subscribers: ashoat, tomek, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "services/commtest/tests/backup/pull_backup.rs", "new_path": "services/commtest/tests/backup/pull_backup.rs", "diff": "@@ -3,8 +3,8 @@ mod backup_utils;\n#[path = \"../lib/tools.rs\"]\nmod tools;\n-use tonic::Request;\nuse std::io::{Error as IOError, ErrorKind};\n+use tonic::Request;\nuse crate::backup_utils::{\nproto::pull_backup_response::Data, proto::pull_backup_response::Data::*,\n@@ -63,7 +63,10 @@ pub async fn run(\n\"invalid state, expected compaction, got {:?}\",\nstate\n);\n- current_id = backup_id.ok_or(IOError::new(ErrorKind::Other, \"backup id expected but not received\"))?;\n+ current_id = backup_id.ok_or(IOError::new(\n+ ErrorKind::Other,\n+ \"backup id expected but not received\",\n+ ))?;\nprintln!(\n\"compaction (id {}), pushing chunk (size: {})\",\ncurrent_id,\n@@ -76,7 +79,10 @@ pub async fn run(\nstate = State::Log;\n}\nassert_eq!(state, State::Log, \"invalid state, expected compaction\");\n- let log_id = log_id.ok_or(IOError::new(ErrorKind::Other, \"log id expected but not received\"))?;\n+ let log_id = log_id.ok_or(IOError::new(\n+ ErrorKind::Other,\n+ \"log id expected but not received\",\n+ ))?;\nif log_id != current_id {\nresult.log_items.push(Item::new(\nlog_id.clone(),\n" }, { "change_type": "MODIFY", "old_path": "services/commtest/tests/backup_test.rs", "new_path": "services/commtest/tests/backup_test.rs", "diff": "@@ -61,10 +61,7 @@ async fn backup_test() -> Result<(), Error> {\n// a big item that should be placed in the S3 right away\nItem::new(\nString::new(),\n- vec![\n- *tools::GRPC_CHUNK_SIZE_LIMIT,\n- *tools::GRPC_CHUNK_SIZE_LIMIT,\n- ],\n+ vec![*tools::GRPC_CHUNK_SIZE_LIMIT, *tools::GRPC_CHUNK_SIZE_LIMIT],\nvec![\n\"holder0\".to_string(),\n\"holder1\".to_string(),\n" }, { "change_type": "MODIFY", "old_path": "services/commtest/tests/lib/tools.rs", "new_path": "services/commtest/tests/lib/tools.rs", "diff": "@@ -25,8 +25,10 @@ pub enum Error {\npub const GRPC_METADATA_SIZE_BYTES: usize = 5;\nlazy_static! {\n- pub static ref DYNAMO_DB_ITEM_SIZE_LIMIT: usize = ByteSize::kib(400).as_u64() as usize;\n- pub static ref GRPC_CHUNK_SIZE_LIMIT: usize = (ByteSize::mib(4).as_u64() as usize) - GRPC_METADATA_SIZE_BYTES;\n+ pub static ref DYNAMO_DB_ITEM_SIZE_LIMIT: usize =\n+ ByteSize::kib(400).as_u64() as usize;\n+ pub static ref GRPC_CHUNK_SIZE_LIMIT: usize =\n+ (ByteSize::mib(4).as_u64() as usize) - GRPC_METADATA_SIZE_BYTES;\n}\n#[allow(dead_code)]\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Tests - Run formatter Summary: Depends on D4555 Running rust formater on the tests. Test Plan: None really, it's just code styling, the code compiles and runs as before. Reviewers: tomek, varun Reviewed By: tomek, varun Subscribers: ashoat, tomek, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4598
129,190
18.07.2022 15:58:45
-7,200
499626f0d48d71298df1244d531d5fa7ca2dc281
[services] Backup - pull backup - change tests Summary: Depends on D4598 Test all the changes from the last 3 diffs. Test Plan: ``` cd services yarn run-blob-service-in-sandbox yarn run-backup-service-in-sandbox yarn run-integration-tests backup ``` Reviewers: tomek Subscribers: ashoat, tomek, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "services/commtest/tests/backup/pull_backup.rs", "new_path": "services/commtest/tests/backup/pull_backup.rs", "diff": "@@ -68,7 +68,7 @@ pub async fn run(\n\"backup id expected but not received\",\n))?;\nprintln!(\n- \"compaction (id {}), pushing chunk (size: {})\",\n+ \"compaction (id {}), pulling chunk (size: {})\",\ncurrent_id,\nchunk.len()\n);\n@@ -78,7 +78,12 @@ pub async fn run(\nif state == State::Compaction {\nstate = State::Log;\n}\n- assert_eq!(state, State::Log, \"invalid state, expected compaction\");\n+ assert_eq!(\n+ state,\n+ State::Log,\n+ \"invalid state, expected log, got {:?}\",\n+ state\n+ );\nlet log_id = log_id.ok_or(IOError::new(\nErrorKind::Other,\n\"log id expected but not received\",\n@@ -98,26 +103,28 @@ pub async fn run(\nprintln!(\"log (id {}) chunk size {}\", current_id, chunk.len());\n}\n- Some(AttachmentHolders(holders)) => {\n+ None => {}\n+ }\n+ if let Some(holders) = response.attachment_holders {\nlet holders_split: Vec<&str> =\nholders.split(ATTACHMENT_DELIMITER).collect();\nif state == State::Compaction {\n- println!(\"attachments for the backup: {}\", holders);\nfor holder in holders_split {\nif holder.len() == 0 {\ncontinue;\n}\n+ println!(\"attachments for the backup: {}\", holders);\nresult\n.backup_item\n.attachments_holders\n.push(holder.to_string());\n}\n} else if state == State::Log {\n- println!(\"attachments for the log: {}\", holders);\nfor holder in holders_split {\nif holder.len() == 0 {\ncontinue;\n}\n+ println!(\"attachments for the log: {}\", holders);\nlet log_items_size = result.log_items.len() - 1;\nresult.log_items[log_items_size]\n.attachments_holders\n@@ -125,8 +132,6 @@ pub async fn run(\n}\n}\n}\n- None => {}\n- }\n}\nOk(result)\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Backup - pull backup - change tests Summary: Depends on D4598 Test all the changes from the last 3 diffs. Test Plan: ``` cd services yarn run-blob-service-in-sandbox yarn run-backup-service-in-sandbox yarn run-integration-tests backup ``` Reviewers: tomek Reviewed By: tomek Subscribers: ashoat, tomek, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4556
129,184
25.07.2022 10:14:09
14,400
ddf524180469be07718f81742686dfe8b29aaa7b
[lintstaged] Add Jest tests to `.lintstaged.js` Summary: Run `lib` and `keyserver` tests for the same conditions that `flow` is run in those directories. Test Plan: Proof that the tests run: {F115690} Reviewers: jacek, abosh, varun, tomek Subscribers: ashoat, adrian
[ { "change_type": "MODIFY", "old_path": ".lintstagedrc.js", "new_path": ".lintstagedrc.js", "diff": "@@ -17,6 +17,9 @@ module.exports = {\n'lib/**/*.js': function libFlow(files) {\nreturn 'yarn workspace lib flow --quiet';\n},\n+ 'lib/**/*.js': function libTest(files) {\n+ return 'yarn workspace lib test';\n+ },\n'{web,lib}/**/*.js': function webFlow(files) {\nreturn 'yarn workspace web flow --quiet';\n},\n@@ -26,6 +29,9 @@ module.exports = {\n'{keyserver,web,lib}/**/*.js': function keyServerFlow(files) {\nreturn 'yarn workspace keyserver flow --quiet';\n},\n+ '{keyserver,web,lib}/**/*.js': function keyServerTest(files) {\n+ return 'yarn workspace keyserver test';\n+ },\n'{landing,lib}/**/*.js': function landingFlow(files) {\nreturn 'yarn workspace landing flow --quiet';\n},\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lintstaged] Add Jest tests to `.lintstaged.js` Summary: Run `lib` and `keyserver` tests for the same conditions that `flow` is run in those directories. Test Plan: Proof that the tests run: {F115690} Reviewers: jacek, abosh, varun, tomek Reviewed By: abosh, varun Subscribers: ashoat, adrian Differential Revision: https://phab.comm.dev/D4619
129,184
25.07.2022 10:45:08
14,400
c95753960ef587df8010013c0a03a0a69c1a1c0c
[lintstaged] Rename `keyServer` => `keyserver` Summary: `keyserver` is one "word" so shouldn't be camelCase. Test Plan: Made a change in `/keyserver` and made sure that the `lintstaged` steps ran as expected. Reviewers: tomek, jacek, abosh, varun Subscribers: ashoat, adrian
[ { "change_type": "MODIFY", "old_path": ".lintstagedrc.js", "new_path": ".lintstagedrc.js", "diff": "@@ -26,10 +26,10 @@ module.exports = {\n'{native,lib}/**/*.js': function nativeFlow(files) {\nreturn 'yarn workspace native flow --quiet';\n},\n- '{keyserver,web,lib}/**/*.js': function keyServerFlow(files) {\n+ '{keyserver,web,lib}/**/*.js': function keyserverFlow(files) {\nreturn 'yarn workspace keyserver flow --quiet';\n},\n- '{keyserver,web,lib}/**/*.js': function keyServerTest(files) {\n+ '{keyserver,web,lib}/**/*.js': function keyserverTest(files) {\nreturn 'yarn workspace keyserver test';\n},\n'{landing,lib}/**/*.js': function landingFlow(files) {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lintstaged] Rename `keyServer` => `keyserver` Summary: `keyserver` is one "word" so shouldn't be camelCase. Test Plan: Made a change in `/keyserver` and made sure that the `lintstaged` steps ran as expected. Reviewers: tomek, jacek, abosh, varun Reviewed By: abosh, varun Subscribers: ashoat, adrian Differential Revision: https://phab.comm.dev/D4620
129,185
26.07.2022 10:10:21
-7,200
633414d383083bbb63aaa78878d8abe9e99c395f
[web] Remove old `NewThreadModal` component Summary: The diff removes old `NewThreadModal` component that was not used anywhere. Also styles for this modal from `style.css` has been removed. Test Plan: Web app build and runs as before Reviewers: tomek, atul Subscribers: ashoat, adrian, abosh
[ { "change_type": "DELETE", "old_path": "web/modals/threads/new-thread-modal.react.js", "new_path": null, "diff": "-// @flow\n-\n-import invariant from 'invariant';\n-import * as React from 'react';\n-\n-import { newThreadActionTypes, newThread } from 'lib/actions/thread-actions';\n-import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors';\n-import { threadInfoSelector } from 'lib/selectors/thread-selectors';\n-import {\n- generateRandomColor,\n- threadTypeDescriptions,\n-} from 'lib/shared/thread-utils';\n-import type { CalendarQuery } from 'lib/types/entry-types';\n-import {\n- type ThreadInfo,\n- threadTypes,\n- assertThreadType,\n- type ThreadType,\n- type ClientNewThreadRequest,\n- type NewThreadResult,\n-} from 'lib/types/thread-types';\n-import {\n- type DispatchActionPromise,\n- useDispatchActionPromise,\n- useServerCall,\n-} from 'lib/utils/action-utils';\n-import { firstLine } from 'lib/utils/string-utils';\n-\n-import Button from '../../components/button.react';\n-import { useSelector } from '../../redux/redux-utils';\n-import { nonThreadCalendarQuery } from '../../selectors/nav-selectors';\n-import css from '../../style.css';\n-import Modal from '../modal.react';\n-import ColorPicker from './color-picker.react';\n-\n-type BaseProps = {\n- +onClose: () => void,\n- +parentThreadID?: ?string,\n-};\n-type Props = {\n- ...BaseProps,\n- +inputDisabled: boolean,\n- +calendarQuery: () => CalendarQuery,\n- +parentThreadInfo: ?ThreadInfo,\n- +dispatchActionPromise: DispatchActionPromise,\n- +newThread: (request: ClientNewThreadRequest) => Promise<NewThreadResult>,\n-};\n-type State = {\n- +threadType: ?ThreadType,\n- +name: string,\n- +description: string,\n- +color: string,\n- +errorMessage: string,\n-};\n-\n-const { COMMUNITY_OPEN_SUBTHREAD, COMMUNITY_SECRET_SUBTHREAD } = threadTypes;\n-\n-class NewThreadModal extends React.PureComponent<Props, State> {\n- nameInput: ?HTMLInputElement;\n- openPrivacyInput: ?HTMLInputElement;\n- threadPasswordInput: ?HTMLInputElement;\n-\n- constructor(props: Props) {\n- super(props);\n- this.state = {\n- threadType: props.parentThreadID ? undefined : COMMUNITY_SECRET_SUBTHREAD,\n- name: '',\n- description: '',\n- color: props.parentThreadInfo\n- ? props.parentThreadInfo.color\n- : generateRandomColor(),\n- errorMessage: '',\n- };\n- }\n-\n- componentDidMount() {\n- invariant(this.nameInput, 'nameInput ref unset');\n- this.nameInput.focus();\n- }\n-\n- render() {\n- let threadTypeSection = null;\n- if (this.props.parentThreadID) {\n- threadTypeSection = (\n- <div className={css['new-thread-privacy-container']}>\n- <div className={css['modal-radio-selector']}>\n- <div className={css['form-title']}>Chat type</div>\n- <div className={css['form-enum-selector']}>\n- <div className={css['form-enum-container']}>\n- <input\n- type=\"radio\"\n- name=\"new-thread-type\"\n- id=\"new-thread-open\"\n- value={COMMUNITY_OPEN_SUBTHREAD}\n- checked={this.state.threadType === COMMUNITY_OPEN_SUBTHREAD}\n- onChange={this.onChangeThreadType}\n- disabled={this.props.inputDisabled}\n- ref={this.openPrivacyInputRef}\n- />\n- <div className={css['form-enum-option']}>\n- <label htmlFor=\"new-thread-open\">\n- Open\n- <span className={css['form-enum-description']}>\n- {threadTypeDescriptions[COMMUNITY_OPEN_SUBTHREAD]}\n- </span>\n- </label>\n- </div>\n- </div>\n- <div className={css['form-enum-container']}>\n- <input\n- type=\"radio\"\n- name=\"new-thread-type\"\n- id=\"new-thread-closed\"\n- value={COMMUNITY_SECRET_SUBTHREAD}\n- checked={this.state.threadType === COMMUNITY_SECRET_SUBTHREAD}\n- onChange={this.onChangeThreadType}\n- disabled={this.props.inputDisabled}\n- />\n- <div className={css['form-enum-option']}>\n- <label htmlFor=\"new-thread-closed\">\n- Secret\n- <span className={css['form-enum-description']}>\n- {threadTypeDescriptions[COMMUNITY_SECRET_SUBTHREAD]}\n- </span>\n- </label>\n- </div>\n- </div>\n- </div>\n- </div>\n- </div>\n- );\n- }\n- return (\n- <Modal name=\"New chat\" onClose={this.props.onClose} size=\"large\">\n- <div className={css['modal-body']}>\n- <form method=\"POST\">\n- <div>\n- <div className={css['form-title']}>Chat name</div>\n- <div className={css['form-content']}>\n- <input\n- type=\"text\"\n- value={firstLine(this.state.name)}\n- placeholder=\"Chat name\"\n- onChange={this.onChangeName}\n- disabled={this.props.inputDisabled}\n- ref={this.nameInputRef}\n- />\n- </div>\n- </div>\n- <div className={css['form-textarea-container']}>\n- <div className={css['form-title']}>Description</div>\n- <div className={css['form-content']}>\n- <textarea\n- value={this.state.description}\n- placeholder=\"Chat description\"\n- onChange={this.onChangeDescription}\n- disabled={this.props.inputDisabled}\n- />\n- </div>\n- </div>\n- {threadTypeSection}\n- <div>\n- <div className={`${css['form-title']} ${css['color-title']}`}>\n- Color\n- </div>\n- <div className={css['form-content']}>\n- <ColorPicker\n- id=\"new-thread-color\"\n- value={this.state.color}\n- disabled={this.props.inputDisabled}\n- onChange={this.onChangeColor}\n- />\n- </div>\n- </div>\n- <div className={css['form-footer']}>\n- <Button\n- onClick={this.onSubmit}\n- disabled={this.props.inputDisabled}\n- type=\"submit\"\n- >\n- Save\n- </Button>\n- <div className={css['modal-form-error']}>\n- {this.state.errorMessage}\n- </div>\n- </div>\n- </form>\n- </div>\n- </Modal>\n- );\n- }\n-\n- nameInputRef = (nameInput: ?HTMLInputElement) => {\n- this.nameInput = nameInput;\n- };\n-\n- openPrivacyInputRef = (openPrivacyInput: ?HTMLInputElement) => {\n- this.openPrivacyInput = openPrivacyInput;\n- };\n-\n- onChangeName = (event: SyntheticEvent<HTMLInputElement>) => {\n- const target = event.target;\n- invariant(target instanceof HTMLInputElement, 'target not input');\n- this.setState({ name: firstLine(target.value) });\n- };\n-\n- onChangeDescription = (event: SyntheticEvent<HTMLTextAreaElement>) => {\n- const target = event.target;\n- invariant(target instanceof HTMLTextAreaElement, 'target not textarea');\n- this.setState({ description: target.value });\n- };\n-\n- onChangeColor = (color: string) => {\n- this.setState({ color: color });\n- };\n-\n- onChangeThreadType = (event: SyntheticEvent<HTMLInputElement>) => {\n- const target = event.target;\n- invariant(target instanceof HTMLInputElement, 'target not input');\n- this.setState({\n- threadType: assertThreadType(parseInt(target.value, 10)),\n- });\n- };\n-\n- onSubmit = (event: SyntheticEvent<HTMLElement>) => {\n- event.preventDefault();\n-\n- const threadType = this.state.threadType;\n- invariant(\n- threadType !== null,\n- 'threadType state should never be set to null',\n- );\n- if (threadType === undefined) {\n- this.setState(\n- {\n- errorMessage: 'chat type unspecified',\n- },\n- () => {\n- invariant(this.openPrivacyInput, 'openPrivacyInput ref unset');\n- this.openPrivacyInput.focus();\n- },\n- );\n- return;\n- }\n-\n- this.props.dispatchActionPromise(\n- newThreadActionTypes,\n- this.newThreadAction(threadType),\n- );\n- };\n-\n- async newThreadAction(threadType: ThreadType) {\n- const name = this.state.name.trim();\n- try {\n- invariant(\n- threadType === 3 ||\n- threadType === 4 ||\n- threadType === 6 ||\n- threadType === 7,\n- \"Sidebars and communities can't be created from the chat composer\",\n- );\n- const query = this.props.calendarQuery();\n- const response = await this.props.newThread({\n- type: threadType,\n- name,\n- description: this.state.description,\n- color: this.state.color,\n- calendarQuery: query,\n- });\n- this.props.onClose();\n- return response;\n- } catch (e) {\n- this.setState(\n- {\n- threadType: undefined,\n- name: '',\n- description: '',\n- color: '',\n- errorMessage: 'unknown error',\n- },\n- () => {\n- invariant(this.nameInput, 'nameInput ref unset');\n- this.nameInput.focus();\n- },\n- );\n- throw e;\n- }\n- }\n-}\n-\n-const loadingStatusSelector = createLoadingStatusSelector(newThreadActionTypes);\n-\n-const ConnectedNewThreadModal: React.ComponentType<BaseProps> = React.memo<BaseProps>(\n- function ConnectedNewThreadModal(props) {\n- const { parentThreadID } = props;\n- const parentThreadInfo: ?ThreadInfo = useSelector(state =>\n- parentThreadID ? threadInfoSelector(state)[parentThreadID] : null,\n- );\n- invariant(!parentThreadID || parentThreadInfo, 'parent chat should exist');\n- const inputDisabled = useSelector(loadingStatusSelector) === 'loading';\n- const calendarQuery = useSelector(nonThreadCalendarQuery);\n- const callNewThread = useServerCall(newThread);\n- const dispatchActionPromise = useDispatchActionPromise();\n-\n- return (\n- <NewThreadModal\n- {...props}\n- parentThreadInfo={parentThreadInfo}\n- inputDisabled={inputDisabled}\n- calendarQuery={calendarQuery}\n- newThread={callNewThread}\n- dispatchActionPromise={dispatchActionPromise}\n- />\n- );\n- },\n-);\n-\n-export default ConnectedNewThreadModal;\n" }, { "change_type": "MODIFY", "old_path": "web/style.css", "new_path": "web/style.css", "diff": "@@ -164,35 +164,6 @@ span.loading-indicator-error-black {\nline-height: 0;\n}\n-div.form-enum-selector {\n- display: inline-block;\n- padding-bottom: 4px;\n-}\n-div.form-enum-selector > div.form-enum-container {\n- padding-top: 5px;\n-}\n-div.form-enum-selector > div.form-enum-container > input {\n- vertical-align: top;\n- margin-top: 4px;\n-}\n-div.form-enum-selector div.form-enum-option {\n- display: inline-block;\n- font-size: 15px;\n- font-weight: 600;\n- padding-left: 3px;\n-}\n-div.form-enum-selector span.form-enum-description {\n- display: block;\n- font-family: var(--font-stack);\n- font-weight: normal;\n- font-size: 13px;\n- max-width: 260px;\n- color: gray;\n-}\n-div.color-title {\n- margin-top: 4px;\n-}\n-\n.hidden {\ndisplay: none;\n}\n@@ -200,15 +171,6 @@ div.color-title {\nfont-style: italic;\n}\n-div.form-textarea-container {\n- margin-top: 1px;\n-}\n-\n-div.new-thread-privacy-container {\n- margin-bottom: 3px;\n- margin-top: -6px;\n-}\n-\nspan.page-loading {\nmargin-top: 5px;\nmargin-right: 12px;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] Remove old `NewThreadModal` component Summary: The diff removes old `NewThreadModal` component that was not used anywhere. Also styles for this modal from `style.css` has been removed. Test Plan: Web app build and runs as before Reviewers: tomek, atul Reviewed By: atul Subscribers: ashoat, adrian, abosh Differential Revision: https://phab.comm.dev/D4618
129,190
21.07.2022 11:30:36
-7,200
2eb10c1818e3861ccebc65808eaed1043e1ea7c2
[services] Tunnelbroker - remove include iostream Summary: Depends on D4591 Removing `#include <iostream>` everywhere. This include was used for `std::cout` and since we quit using it, we can clear out all such includes. Test Plan: Tunnelbroker builds. Reviewers: tomek, max Subscribers: ashoat, tomek, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "services/tunnelbroker/src/DeliveryBroker/DeliveryBroker.h", "new_path": "services/tunnelbroker/src/DeliveryBroker/DeliveryBroker.h", "diff": "#include <folly/concurrency/ConcurrentHashMap.h>\n-#include <iostream>\n#include <string>\nnamespace comm {\n" }, { "change_type": "MODIFY", "old_path": "services/tunnelbroker/src/Service/TunnelbrokerServiceImpl.h", "new_path": "services/tunnelbroker/src/Service/TunnelbrokerServiceImpl.h", "diff": "#include <grpcpp/grpcpp.h>\n-#include <iostream>\n#include <string>\nnamespace comm {\n" }, { "change_type": "MODIFY", "old_path": "services/tunnelbroker/src/Tools/ConfigManager.h", "new_path": "services/tunnelbroker/src/Tools/ConfigManager.h", "diff": "#include <boost/program_options.hpp>\n-#include <iostream>\n#include <string>\nnamespace comm {\n" }, { "change_type": "MODIFY", "old_path": "services/tunnelbroker/src/Tools/CryptoTools.cpp", "new_path": "services/tunnelbroker/src/Tools/CryptoTools.cpp", "diff": "#include <cryptopp/rsa.h>\n#include <glog/logging.h>\n-#include <iostream>\n-\nnamespace comm {\nnamespace network {\nnamespace crypto {\n" }, { "change_type": "MODIFY", "old_path": "services/tunnelbroker/src/Tools/Tools.cpp", "new_path": "services/tunnelbroker/src/Tools/Tools.cpp", "diff": "#include <boost/lexical_cast.hpp>\n#include <chrono>\n-#include <iostream>\n#include <random>\n#include <regex>\n" }, { "change_type": "MODIFY", "old_path": "services/tunnelbroker/src/server.cpp", "new_path": "services/tunnelbroker/src/server.cpp", "diff": "#include <glog/logging.h>\n#include <grpcpp/grpcpp.h>\n-#include <iostream>\n#include <string>\n#include <thread>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Tunnelbroker - remove include iostream Summary: Depends on D4591 Removing `#include <iostream>` everywhere. This include was used for `std::cout` and since we quit using it, we can clear out all such includes. Test Plan: Tunnelbroker builds. Reviewers: tomek, max Reviewed By: tomek, max Subscribers: ashoat, tomek, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4592
129,190
21.07.2022 11:31:02
-7,200
7a3c6c729a56e74bae59f059c12a26a50ba9eaf1
[services] Backup - remove include iostream Summary: Depends on D4592 Removing `#include <iostream>` everywhere. This include was used for `std::cout` and since we quit using it, we can clear out all such includes. Test Plan: Backup builds Reviewers: tomek, max Subscribers: ashoat, tomek, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "services/backup/src/DatabaseManager.cpp", "new_path": "services/backup/src/DatabaseManager.cpp", "diff": "#include <aws/dynamodb/model/ScanRequest.h>\n#include <aws/dynamodb/model/UpdateItemRequest.h>\n-#include <iostream>\n-\nnamespace comm {\nnamespace network {\nnamespace database {\n" }, { "change_type": "MODIFY", "old_path": "services/backup/src/Reactors/client/blob/BlobPutClientReactor.cpp", "new_path": "services/backup/src/Reactors/client/blob/BlobPutClientReactor.cpp", "diff": "#include \"BlobPutClientReactor.h\"\n-#include <iostream>\n-\nnamespace comm {\nnamespace network {\nnamespace reactor {\n" }, { "change_type": "MODIFY", "old_path": "services/backup/src/Reactors/server/PullBackupReactor.cpp", "new_path": "services/backup/src/Reactors/server/PullBackupReactor.cpp", "diff": "#include \"DatabaseManager.h\"\n-#include <iostream>\n-\nnamespace comm {\nnamespace network {\nnamespace reactor {\n" }, { "change_type": "MODIFY", "old_path": "services/backup/src/Reactors/server/RecoverBackupKeyReactor.h", "new_path": "services/backup/src/Reactors/server/RecoverBackupKeyReactor.h", "diff": "#include \"../_generated/backup.grpc.pb.h\"\n#include \"../_generated/backup.pb.h\"\n-#include <iostream>\n#include <memory>\n#include <string>\n" }, { "change_type": "MODIFY", "old_path": "services/backup/src/grpc-client/ServiceBlobClient.h", "new_path": "services/backup/src/grpc-client/ServiceBlobClient.h", "diff": "#include <grpcpp/grpcpp.h>\n-#include <iostream>\n#include <memory>\n#include <string>\n" }, { "change_type": "MODIFY", "old_path": "services/backup/test/DatabaseManagerTest.cpp", "new_path": "services/backup/test/DatabaseManagerTest.cpp", "diff": "#include \"GlobalTools.h\"\n#include \"Tools.h\"\n-#include <iostream>\n-\n#include <memory>\n#include <string>\n#include <vector>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Backup - remove include iostream Summary: Depends on D4592 Removing `#include <iostream>` everywhere. This include was used for `std::cout` and since we quit using it, we can clear out all such includes. Test Plan: Backup builds Reviewers: tomek, max Reviewed By: tomek, max Subscribers: ashoat, tomek, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4593
129,190
21.07.2022 11:31:25
-7,200
60452ea0821ab55bc23768d09740d30842bd39a9
[services] Blob - remove include iostream Summary: Depends on D4593 Removing `#include <iostream>` everywhere. This include was used for `std::cout` and since we quit using it, we can clear out all such includes. Test Plan: Blob builds Reviewers: tomek, max Subscribers: ashoat, tomek, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "services/blob/src/BlobServiceImpl.cpp", "new_path": "services/blob/src/BlobServiceImpl.cpp", "diff": "#include <glog/logging.h>\n-#include <iostream>\n#include <memory>\nnamespace comm {\n" }, { "change_type": "MODIFY", "old_path": "services/blob/src/DatabaseManager.cpp", "new_path": "services/blob/src/DatabaseManager.cpp", "diff": "#include <aws/dynamodb/model/QueryRequest.h>\n#include <aws/dynamodb/model/ScanRequest.h>\n-#include <iostream>\n#include <vector>\nnamespace comm {\n" }, { "change_type": "MODIFY", "old_path": "services/blob/src/Reactors/server/GetReactor.h", "new_path": "services/blob/src/Reactors/server/GetReactor.h", "diff": "#include <aws/s3/model/GetObjectRequest.h>\n-#include <iostream>\n#include <memory>\n#include <string>\n" }, { "change_type": "MODIFY", "old_path": "services/blob/src/server.cpp", "new_path": "services/blob/src/server.cpp", "diff": "#include <glog/logging.h>\n#include <grpcpp/grpcpp.h>\n-#include <iostream>\n#include <memory>\n#include <string>\n" }, { "change_type": "MODIFY", "old_path": "services/blob/test/DatabaseManagerTest.cpp", "new_path": "services/blob/test/DatabaseManagerTest.cpp", "diff": "#include \"DatabaseManager.h\"\n#include \"S3Path.h\"\n-#include <iostream>\n-\n#include <algorithm>\n#include <chrono>\n#include <memory>\n" }, { "change_type": "MODIFY", "old_path": "services/blob/test/StorageManagerTest.cpp", "new_path": "services/blob/test/StorageManagerTest.cpp", "diff": "#include <aws/core/Aws.h>\n#include <chrono>\n-#include <iostream>\n#include <memory>\n#include <string>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Blob - remove include iostream Summary: Depends on D4593 Removing `#include <iostream>` everywhere. This include was used for `std::cout` and since we quit using it, we can clear out all such includes. Test Plan: Blob builds Reviewers: tomek, max Reviewed By: tomek, max Subscribers: ashoat, tomek, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4594
129,190
26.07.2022 13:19:09
-7,200
0dc8a1937bd6cebb584a3df09b295922ee8188d5
[services] Use mutual server listen address Summary: Depends on D4595 This is a follow-up for Test Plan: Services build properly (tunnelbroker, blob, backup) Reviewers: tomek, max Subscribers: ashoat, tomek, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "services/backup/src/server.cpp", "new_path": "services/backup/src/server.cpp", "diff": "#include \"BackupServiceImpl.h\"\n+#include \"GlobalConstants.h\"\n#include \"GlobalTools.h\"\n#include <glog/logging.h>\n#include <grpcpp/grpcpp.h>\n#include <memory>\n-#include <string>\nnamespace comm {\nnamespace network {\nvoid RunServer() {\n- std::string server_address = \"0.0.0.0:50051\";\nBackupServiceImpl backupService;\ngrpc::EnableDefaultHealthCheckService(true);\ngrpc::ServerBuilder builder;\n// Listen on the given address without any authentication mechanism.\n- builder.AddListeningPort(server_address, grpc::InsecureServerCredentials());\n+ builder.AddListeningPort(\n+ SERVER_LISTEN_ADDRESS, grpc::InsecureServerCredentials());\n// Register \"service\" as the instance through which we'll communicate with\n// clients. In this case it corresponds to an *synchronous* service.\nbuilder.RegisterService(&backupService);\n// Finally assemble the server.\nstd::unique_ptr<grpc::Server> server(builder.BuildAndStart());\n- LOG(INFO) << \"Server listening\";\n+ LOG(INFO) << \"server listening at :\" << SERVER_LISTEN_ADDRESS;\n// Wait for the server to shutdown. Note that some other thread must be\n// responsible for shutting down the server for this call to ever return.\n" }, { "change_type": "MODIFY", "old_path": "services/blob/src/server.cpp", "new_path": "services/blob/src/server.cpp", "diff": "#include \"BlobServiceImpl.h\"\n+#include \"GlobalConstants.h\"\n#include \"GlobalTools.h\"\n#include <glog/logging.h>\n#include <grpcpp/grpcpp.h>\n#include <memory>\n-#include <string>\nnamespace comm {\nnamespace network {\nvoid RunServer() {\n- std::string server_address = \"0.0.0.0:50051\";\nBlobServiceImpl blobService;\ngrpc::EnableDefaultHealthCheckService(true);\ngrpc::ServerBuilder builder;\n- builder.AddListeningPort(server_address, grpc::InsecureServerCredentials());\n+ builder.AddListeningPort(\n+ SERVER_LISTEN_ADDRESS, grpc::InsecureServerCredentials());\nbuilder.RegisterService(&blobService);\nstd::unique_ptr<grpc::Server> server(builder.BuildAndStart());\n- LOG(INFO) << \"Server listening\";\n+ LOG(INFO) << \"server listening at :\" << SERVER_LISTEN_ADDRESS;\nserver->Wait();\n}\n" }, { "change_type": "MODIFY", "old_path": "services/lib/src/GlobalConstants.h", "new_path": "services/lib/src/GlobalConstants.h", "diff": "@@ -24,5 +24,8 @@ const std::string AWS_REGION = \"us-east-2\";\nconst char ATTACHMENT_DELIMITER = ';';\n+// gRPC Server\n+const std::string SERVER_LISTEN_ADDRESS = \"0.0.0.0:50051\";\n+\n} // namespace network\n} // namespace comm\n" }, { "change_type": "MODIFY", "old_path": "services/tunnelbroker/src/Constants.h", "new_path": "services/tunnelbroker/src/Constants.h", "diff": "@@ -26,9 +26,6 @@ const size_t SESSION_SIGN_RECORD_TTL = 24 * 3600; // 24 hours\nconst std::regex SESSION_ID_FORMAT_REGEX(\n\"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\");\n-// gRPC Server\n-const std::string SERVER_LISTEN_ADDRESS = \"0.0.0.0:50051\";\n-\n// AMQP (RabbitMQ)\nconst std::string AMQP_FANOUT_EXCHANGE_NAME = \"allBrokers\";\n// Message broker queue message TTL\n" }, { "change_type": "MODIFY", "old_path": "services/tunnelbroker/src/server.cpp", "new_path": "services/tunnelbroker/src/server.cpp", "diff": "#include \"GlobalTools.h\"\n#include \"TunnelbrokerServiceImpl.h\"\n+#include \"GlobalConstants.h\"\n+\n#include <glog/logging.h>\n#include <grpcpp/grpcpp.h>\n@@ -24,7 +26,7 @@ void RunServer() {\n// clients. In this case it corresponds to an *synchronous* service.\nbuilder.RegisterService(&service);\nstd::unique_ptr<grpc::Server> server(builder.BuildAndStart());\n- LOG(INFO) << \"gRPC Server listening at :\" << SERVER_LISTEN_ADDRESS;\n+ LOG(INFO) << \"server listening at :\" << SERVER_LISTEN_ADDRESS;\n// Wait for the server to shutdown. Note that some other thread must be\n// responsible for shutting down the server for this call to ever return.\nserver->Wait();\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Use mutual server listen address Summary: Depends on D4595 This is a follow-up for https://phab.comm.dev/D4590#131582 Test Plan: Services build properly (tunnelbroker, blob, backup) Reviewers: tomek, max Reviewed By: tomek Subscribers: ashoat, tomek, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4639
129,185
26.07.2022 17:29:04
-7,200
296f64250f2eb1d8d7bb3e49ff0082450d54b265
[web] Introduce `Sidebar` component Summary: Introduce component displaying single Sidebar item in the list in Sidebars Modal on web. {F113322} Test Plan: The component will be used in the following diffs introducing the modal. Reviewers: tomek, atul, ashoat Subscribers: ashoat, adrian, abosh
[ { "change_type": "ADD", "old_path": null, "new_path": "web/modals/threads/sidebars/sidebar.react.js", "diff": "+// @flow\n+\n+import * as React from 'react';\n+\n+import type { ChatThreadItem } from 'lib/selectors/chat-selectors';\n+import { getMessagePreview } from 'lib/shared/message-utils';\n+import { shortAbsoluteDate } from 'lib/utils/date-utils';\n+\n+import { getDefaultTextMessageRules } from '../../../markdown/rules.react';\n+import { useSelector } from '../../../redux/redux-utils';\n+import { useOnClickThread } from '../../../selectors/nav-selectors';\n+import { useModalContext } from '../../modal-provider.react';\n+import css from './sidebars-modal.css';\n+\n+type Props = {\n+ +sidebar: ChatThreadItem,\n+ +isLastItem?: boolean,\n+};\n+\n+function Sidebar(props: Props): React.Node {\n+ const { sidebar, isLastItem } = props;\n+ const { threadInfo, lastUpdatedTime, mostRecentMessageInfo } = sidebar;\n+\n+ const timeZone = useSelector(state => state.timeZone);\n+ const { popModal } = useModalContext();\n+\n+ const navigateToThread = useOnClickThread(threadInfo);\n+\n+ const onClickThread = React.useCallback(\n+ event => {\n+ popModal();\n+ navigateToThread(event);\n+ },\n+ [popModal, navigateToThread],\n+ );\n+\n+ const lastActivity = React.useMemo(\n+ () => shortAbsoluteDate(lastUpdatedTime, timeZone),\n+ [lastUpdatedTime, timeZone],\n+ );\n+\n+ const lastMessage = React.useMemo(() => {\n+ if (!mostRecentMessageInfo) {\n+ return <div className={css.noMessage}>No messages</div>;\n+ }\n+ const { message, username } = getMessagePreview(\n+ mostRecentMessageInfo,\n+ threadInfo,\n+ getDefaultTextMessageRules().simpleMarkdownRules,\n+ );\n+ const previewText = username ? `${username}: ${message}` : message;\n+ return (\n+ <>\n+ <div className={css.longTextEllipsis}>{previewText}</div>\n+ <div className={css.lastActivity}>{lastActivity}</div>\n+ </>\n+ );\n+ }, [lastActivity, mostRecentMessageInfo, threadInfo]);\n+\n+ return (\n+ <button className={css.sidebarContainer} onClick={onClickThread}>\n+ <img\n+ className={css.sidebarArrow}\n+ src={\n+ isLastItem\n+ ? 'images/arrow_sidebar_last.svg'\n+ : 'images/arrow_sidebar.svg'\n+ }\n+ alt=\"sidebar arrow\"\n+ />\n+ <div className={css.sidebarInfo}>\n+ <div className={css.longTextEllipsis}>{threadInfo.name}</div>\n+ <div className={css.lastMessage}>{lastMessage}</div>\n+ </div>\n+ </button>\n+ );\n+}\n+\n+export default Sidebar;\n" }, { "change_type": "ADD", "old_path": null, "new_path": "web/modals/threads/sidebars/sidebars-modal.css", "diff": "+button.sidebarContainer {\n+ cursor: pointer;\n+ display: flex;\n+ padding: 0 16px;\n+ column-gap: 8px;\n+ align-items: flex-start;\n+ width: 100%;\n+ border: none;\n+ font-size: inherit;\n+ text-align: inherit;\n+ line-height: inherit;\n+ color: inherit;\n+ background: inherit;\n+}\n+\n+button.sidebarContainer:hover {\n+ color: var(--sidebars-modal-color-hover);\n+}\n+\n+div.sidebarInfo {\n+ flex: 1;\n+ display: flex;\n+ flex-direction: column;\n+ overflow: hidden;\n+ padding: 8px 0;\n+}\n+\n+div.longTextEllipsis {\n+ text-overflow: ellipsis;\n+ overflow: hidden;\n+ white-space: nowrap;\n+}\n+\n+div.lastMessage {\n+ display: flex;\n+ justify-content: space-between;\n+ column-gap: 14px;\n+}\n+\n+div.noMessage {\n+ text-align: center;\n+ font-style: italic;\n+}\n+\n+div.lastActivity {\n+ white-space: nowrap;\n+}\n+\n+img.sidebarArrow {\n+ position: relative;\n+ top: -12px;\n+}\n" }, { "change_type": "MODIFY", "old_path": "web/theme.css", "new_path": "web/theme.css", "diff": "--thread-creation-search-item-bg-hover: var(--shades-black-80);\n--thread-creation-search-item-info-color: var(--shades-black-60);\n--chat-message-list-active-border: #5989d6;\n+ --sidebars-modal-color-hover: var(--shades-white-100);\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] Introduce `Sidebar` component Summary: Introduce component displaying single Sidebar item in the list in Sidebars Modal on web. {F113322} Test Plan: The component will be used in the following diffs introducing the modal. Reviewers: tomek, atul, ashoat Reviewed By: tomek, ashoat Subscribers: ashoat, adrian, abosh Differential Revision: https://phab.comm.dev/D4608
129,185
26.07.2022 17:29:04
-7,200
0c00898702611218a09852f76161aa6950d9c487
[web] Introduce `SidebarList` component Summary: Introduce component displaying list of sidebars in Sidebars modal. {F113329} {F115291} Test Plan: The component will be used in Sidebars Modal after next diff. Reviewers: tomek, atul, ashoat Subscribers: ashoat, adrian, abosh
[ { "change_type": "ADD", "old_path": null, "new_path": "web/modals/threads/sidebars/sidebar-list.react.js", "diff": "+// @flow\n+\n+import * as React from 'react';\n+\n+import type { ChatThreadItem } from 'lib/selectors/chat-selectors';\n+\n+import Sidebar from './sidebar.react';\n+import css from './sidebars-modal.css';\n+\n+type Props = {\n+ +sidebars: $ReadOnlyArray<ChatThreadItem>,\n+};\n+\n+function SidebarList(props: Props): React.Node {\n+ const { sidebars } = props;\n+\n+ const sidebarItems = React.useMemo(\n+ () =>\n+ sidebars.map((sidebarChatItem, idx, sidebarArray) => (\n+ <Sidebar\n+ sidebar={sidebarChatItem}\n+ key={sidebarChatItem.threadInfo.id}\n+ isLastItem={idx === sidebarArray.length - 1}\n+ />\n+ )),\n+ [sidebars],\n+ );\n+\n+ if (sidebars.length === 0) {\n+ return (\n+ <div className={css.noSidebars}>\n+ No matching threads were found in the chat.\n+ </div>\n+ );\n+ }\n+ return <div className={css.sidebarList}>{sidebarItems}</div>;\n+}\n+\n+export default SidebarList;\n" }, { "change_type": "MODIFY", "old_path": "web/modals/threads/sidebars/sidebars-modal.css", "new_path": "web/modals/threads/sidebars/sidebars-modal.css", "diff": "+div.sidebarList {\n+ overflow: auto;\n+ color: var(--sidebars-modal-color);\n+}\n+\n+div.noSidebars {\n+ padding: 16px;\n+ text-align: center;\n+ color: var(--sidebars-modal-color);\n+}\n+\nbutton.sidebarContainer {\ncursor: pointer;\ndisplay: flex;\n" }, { "change_type": "MODIFY", "old_path": "web/theme.css", "new_path": "web/theme.css", "diff": "--thread-creation-search-item-bg-hover: var(--shades-black-80);\n--thread-creation-search-item-info-color: var(--shades-black-60);\n--chat-message-list-active-border: #5989d6;\n+ --sidebars-modal-color: var(--shades-black-60);\n--sidebars-modal-color-hover: var(--shades-white-100);\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] Introduce `SidebarList` component Summary: Introduce component displaying list of sidebars in Sidebars modal. {F113329} {F115291} Test Plan: The component will be used in Sidebars Modal after next diff. Reviewers: tomek, atul, ashoat Reviewed By: tomek, ashoat Subscribers: ashoat, adrian, abosh Differential Revision: https://phab.comm.dev/D4609
129,185
26.07.2022 17:29:04
-7,200
5b394475454f2d24e9065c511e8a3a4ce9db70c1
[web] Remove old `SidebarListModal` component Summary: The diff removes an old sidebar list modal as it's no longer used. Test Plan: web app should build without errors. The component was no longer used on web. Reviewers: tomek, atul Subscribers: ashoat, adrian, abosh
[ { "change_type": "MODIFY", "old_path": "web/chat/chat-thread-list.css", "new_path": "web/chat/chat-thread-list.css", "diff": "@@ -240,46 +240,6 @@ ul.list {\noverflow: auto;\n}\n-div.search {\n- display: flex;\n- background-color: #dddddd;\n- border-radius: 5px;\n- padding: 3px 5px;\n- align-items: center;\n-}\n-svg.searchVector {\n- fill: #aaaaaa;\n- height: 22px;\n- width: 22px;\n- padding: 0 3px;\n- margin-left: 8px;\n-}\n-div.search > input {\n- color: black;\n- padding: 0;\n- border: none;\n- background-color: #dddddd;\n- font-weight: 600;\n- font-size: 15px;\n- flex-grow: 1;\n- margin-left: 3px;\n-}\n-div.search > input:focus {\n- outline: none;\n-}\n-svg.clearQuery {\n- font-size: 15px;\n- padding-bottom: 1px;\n- padding-right: 2px;\n- color: #aaaaaa;\n-}\n-svg.clearQuery:hover {\n- font-size: 15px;\n- padding-bottom: 1px;\n- padding-right: 2px;\n- color: white;\n-}\n-\ndiv.spacer {\nheight: 6px;\n}\n" }, { "change_type": "DELETE", "old_path": "web/modals/chat/sidebar-list-modal.react.js", "new_path": null, "diff": "-// @flow\n-\n-import { faTimesCircle } from '@fortawesome/free-solid-svg-icons';\n-import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n-import classNames from 'classnames';\n-import * as React from 'react';\n-\n-import { useSearchSidebars } from 'lib/hooks/search-sidebars';\n-import type { ThreadInfo } from 'lib/types/thread-types';\n-\n-import chatThreadListCSS from '../../chat/chat-thread-list.css';\n-import SidebarItem from '../../chat/sidebar-item.react';\n-import globalCSS from '../../style.css';\n-import { MagnifyingGlass } from '../../vectors.react';\n-import Input from '../input.react';\n-import { useModalContext } from '../modal-provider.react';\n-import Modal from '../modal.react';\n-\n-type Props = {\n- +threadInfo: ThreadInfo,\n-};\n-\n-function SidebarListModal(props: Props): React.Node {\n- const { threadInfo } = props;\n- const {\n- listData,\n- searchState,\n- clearQuery,\n- onChangeSearchInputText,\n- } = useSearchSidebars(threadInfo);\n- const { popModal } = useModalContext();\n-\n- const sidebars = React.useMemo(\n- () =>\n- listData.map(item => (\n- <div\n- className={classNames(\n- chatThreadListCSS.thread,\n- chatThreadListCSS.sidebar,\n- )}\n- key={item.threadInfo.id}\n- onClick={popModal}\n- >\n- <SidebarItem sidebarInfo={item} />\n- </div>\n- )),\n- [popModal, listData],\n- );\n-\n- let clearQueryButton = null;\n- if (searchState.text) {\n- clearQueryButton = (\n- <a href=\"#\" onClick={clearQuery}>\n- <FontAwesomeIcon\n- icon={faTimesCircle}\n- className={chatThreadListCSS.clearQuery}\n- />\n- </a>\n- );\n- }\n-\n- const handleOnChangeSearchText = React.useCallback(\n- (event: SyntheticEvent<HTMLInputElement>) => {\n- const { value } = event.currentTarget;\n- onChangeSearchInputText(value);\n- },\n- [onChangeSearchInputText],\n- );\n-\n- return (\n- <Modal name=\"Threads\" onClose={popModal}>\n- <div\n- className={classNames(\n- globalCSS['modal-body'],\n- globalCSS['resized-modal-body'],\n- )}\n- >\n- <div>\n- <div className={chatThreadListCSS.search}>\n- <MagnifyingGlass className={chatThreadListCSS.searchVector} />\n- <Input\n- type=\"text\"\n- placeholder=\"Search threads\"\n- value={searchState.text}\n- onChange={handleOnChangeSearchText}\n- />\n- {clearQueryButton}\n- </div>\n- </div>\n- <ul className={chatThreadListCSS.list}>{sidebars}</ul>\n- </div>\n- </Modal>\n- );\n-}\n-\n-export default SidebarListModal;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] Remove old `SidebarListModal` component Summary: The diff removes an old sidebar list modal as it's no longer used. Test Plan: web app should build without errors. The component was no longer used on web. Reviewers: tomek, atul Reviewed By: tomek Subscribers: ashoat, adrian, abosh Differential Revision: https://phab.comm.dev/D4612
129,192
26.07.2022 18:12:28
-7,200
feb0d5a36ecb0237935a231b55bfd9aa31a46ca0
[services] Backup - Fix missing hash in unit tests Summary: Depends on D4502 Fixing missing hash parameter in LogItem initialisation in generateLogItem function Test Plan: `cd services && yarn run-unit-tests backup` Reviewers: tomek, karol Subscribers: ashoat, tomek, adrian, atul, karol, abosh
[ { "change_type": "MODIFY", "old_path": "services/backup/test/DatabaseManagerTest.cpp", "new_path": "services/backup/test/DatabaseManagerTest.cpp", "diff": "@@ -38,7 +38,8 @@ generateBackupItem(const std::string &userID, const std::string &backupID) {\n}\nLogItem generateLogItem(const std::string &backupID, const std::string &logID) {\n- return LogItem(backupID, logID, false, \"xxx\", {\"\"});\n+ return LogItem(\n+ backupID, logID, false, \"xxx\", {\"\"}, \"1655e920c4eda97e0be1acae74a5ab51\");\n}\nTEST_F(DatabaseManagerTest, TestOperationsOnBackupItems) {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Backup - Fix missing hash in unit tests Summary: Depends on D4502 Fixing missing hash parameter in LogItem initialisation in generateLogItem function Test Plan: `cd services && yarn run-unit-tests backup` Reviewers: tomek, karol Reviewed By: tomek, karol Subscribers: ashoat, tomek, adrian, atul, karol, abosh Differential Revision: https://phab.comm.dev/D4503
129,192
26.07.2022 18:12:29
-7,200
80b0b0f5fb8452e836f53f64b715e0aed7b8c266
[services] Backup - Remove unnecessary brackets in unit test Summary: Depends on D4503 Removing redundant brackets in generating functions Test Plan: `cd services && yarn run-unit-tests backup` Reviewers: tomek, karol Subscribers: ashoat, tomek, adrian, atul, karol, abosh
[ { "change_type": "MODIFY", "old_path": "services/backup/test/DatabaseManagerTest.cpp", "new_path": "services/backup/test/DatabaseManagerTest.cpp", "diff": "@@ -34,12 +34,12 @@ generateBackupItem(const std::string &userID, const std::string &backupID) {\ncomm::network::tools::getCurrentTimestamp(),\n\"xxx\",\n\"xxx\",\n- {\"\"});\n+ \"\");\n}\nLogItem generateLogItem(const std::string &backupID, const std::string &logID) {\nreturn LogItem(\n- backupID, logID, false, \"xxx\", {\"\"}, \"1655e920c4eda97e0be1acae74a5ab51\");\n+ backupID, logID, false, \"xxx\", \"\", \"1655e920c4eda97e0be1acae74a5ab51\");\n}\nTEST_F(DatabaseManagerTest, TestOperationsOnBackupItems) {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Backup - Remove unnecessary brackets in unit test Summary: Depends on D4503 Removing redundant brackets in generating functions Test Plan: `cd services && yarn run-unit-tests backup` Reviewers: tomek, karol Reviewed By: tomek, karol Subscribers: ashoat, tomek, adrian, atul, karol, abosh Differential Revision: https://phab.comm.dev/D4504
129,184
28.07.2022 12:45:38
14,400
8a1bb457ce1f7655324de4befa1d106a244d2125
[keyserver] Bump `notification.mutableContent` version gate to 1000 Summary: Want to defer this for now to isolate changes while troubleshooting iOS crashes. Test Plan: NA Reviewers: ashoat, marcin, tomek Subscribers: adrian, abosh
[ { "change_type": "MODIFY", "old_path": "keyserver/src/push/send.js", "new_path": "keyserver/src/push/send.js", "diff": "@@ -493,7 +493,7 @@ function prepareIOSNotification(\nnotification.payload.id = uniqueID;\nnotification.payload.threadID = threadInfo.id;\nnotification.payload.messageInfos = JSON.stringify(newRawMessageInfos);\n- if (codeVersion > 137) {\n+ if (codeVersion > 1000) {\nnotification.mutableContent = true;\n}\nif (collapseKey) {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[keyserver] Bump `notification.mutableContent` version gate to 1000 Summary: Want to defer this for now to isolate changes while troubleshooting iOS crashes. Test Plan: NA Reviewers: ashoat, marcin, tomek Reviewed By: ashoat Subscribers: adrian, abosh Differential Revision: https://phab.comm.dev/D4668
129,184
28.07.2022 13:14:53
14,400
ebc5aa874bca4f5238114d8a24867c7b7945b745
[native] `codeVersion` -> 138`
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -434,8 +434,8 @@ android {\napplicationId 'app.comm.android'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 137\n- versionName '1.0.137'\n+ versionCode 138\n+ versionName '1.0.138'\nmissingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "new_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "diff": "@@ -13,7 +13,7 @@ namespace comm {\nnamespace jsi = facebook::jsi;\nclass CommCoreModule : public facebook::react::CommCoreModuleSchemaCxxSpecJSI {\n- const int codeVersion{137};\n+ const int codeVersion{138};\nstd::unique_ptr<WorkerThread> databaseThread;\nstd::unique_ptr<WorkerThread> cryptoThread;\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.debug.plist", "new_path": "native/ios/Comm/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.137</string>\n+ <string>1.0.138</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>137</string>\n+ <string>138</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.release.plist", "new_path": "native/ios/Comm/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.137</string>\n+ <string>1.0.138</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>137</string>\n+ <string>138</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] `codeVersion` -> 138`
129,200
27.07.2022 16:33:07
14,400
9ffcf5a5ebca2236f83b0bec5636a9a7e847e767
[services] Helper function to parse userID from AttributeValue Summary: Returns the userID String if present, otherwise returns the appropriate error Depends on D4648 Test Plan: Tested in subsequent diff that uses helper Reviewers: tomek, karol Subscribers: ashoat, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "services/identity/src/database.rs", "new_path": "services/identity/src/database.rs", "diff": "@@ -400,6 +400,25 @@ fn parse_registration_data_attribute(\n}\n}\n+fn parse_string_attribute(\n+ attribute_name: &'static str,\n+ attribute_value: Option<AttributeValue>,\n+) -> Result<String, DBItemError> {\n+ match attribute_value {\n+ Some(AttributeValue::S(user_id)) => Ok(user_id),\n+ Some(_) => Err(DBItemError::new(\n+ attribute_name,\n+ attribute_value,\n+ DBItemAttributeError::IncorrectType,\n+ )),\n+ None => Err(DBItemError::new(\n+ attribute_name,\n+ attribute_value,\n+ DBItemAttributeError::Missing,\n+ )),\n+ }\n+}\n+\n#[cfg(test)]\nmod tests {\nuse super::*;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Helper function to parse userID from AttributeValue Summary: Returns the userID String if present, otherwise returns the appropriate error Depends on D4648 Test Plan: Tested in subsequent diff that uses helper Reviewers: tomek, karol Reviewed By: tomek Subscribers: ashoat, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4656
129,184
28.07.2022 15:50:45
14,400
402eb91623814978ee8640752d4707ba20859452
[native] Don't use `std::move(...)` in return statements in `Session.cpp` Summary: Caught this with `Product -> Analyze` when trying to investigate an unrelated issue. Test Plan: NA Reviewers: ashoat, tomek, karol Subscribers: adrian, abosh
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/CryptoTools/Session.cpp", "new_path": "native/cpp/CommonCpp/CryptoTools/Session.cpp", "diff": "@@ -34,7 +34,7 @@ std::unique_ptr<Session> Session::createSessionAsInitializer(\nthrow std::runtime_error(\n\"error createOutbound => ::olm_create_outbound_session\");\n}\n- return std::move(session);\n+ return session;\n}\nstd::unique_ptr<Session> Session::createSessionAsResponder(\n@@ -56,7 +56,7 @@ std::unique_ptr<Session> Session::createSessionAsResponder(\nthrow std::runtime_error(\n\"error createInbound => ::olm_create_inbound_session\");\n}\n- return std::move(session);\n+ return session;\n}\nOlmBuffer Session::storeAsB64(const std::string &secretKey) {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Don't use `std::move(...)` in return statements in `Session.cpp` Summary: Caught this with `Product -> Analyze` when trying to investigate an unrelated issue. Test Plan: NA Reviewers: ashoat, tomek, karol Reviewed By: ashoat Subscribers: adrian, abosh Differential Revision: https://phab.comm.dev/D4670
129,200
29.07.2022 11:17:34
14,400
0c38f0d781735533d6397baef073239f1c0f5b00
[services] fix variable name Summary: updated a helper function to make it more extensible but forgot to change the names of one of the local variables Test Plan: `cargo build` Reviewers: atul, tomek Subscribers: ashoat, adrian, karol, abosh
[ { "change_type": "MODIFY", "old_path": "services/identity/src/database.rs", "new_path": "services/identity/src/database.rs", "diff": "@@ -468,7 +468,7 @@ fn parse_string_attribute(\nattribute_value: Option<AttributeValue>,\n) -> Result<String, DBItemError> {\nmatch attribute_value {\n- Some(AttributeValue::S(user_id)) => Ok(user_id),\n+ Some(AttributeValue::S(value)) => Ok(value),\nSome(_) => Err(DBItemError::new(\nattribute_name,\nattribute_value,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] fix variable name Summary: updated a helper function to make it more extensible but forgot to change the names of one of the local variables Test Plan: `cargo build` Reviewers: atul, tomek Reviewed By: atul Subscribers: ashoat, adrian, karol, abosh Differential Revision: https://phab.comm.dev/D4682
129,184
29.07.2022 14:33:00
14,400
7a3561cb68ccdf68638b23f7a331bd9626fc0f21
[native] `codeVersion` -> 139
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -434,8 +434,8 @@ android {\napplicationId 'app.comm.android'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 138\n- versionName '1.0.138'\n+ versionCode 139\n+ versionName '1.0.139'\nmissingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "new_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "diff": "@@ -13,7 +13,7 @@ namespace comm {\nnamespace jsi = facebook::jsi;\nclass CommCoreModule : public facebook::react::CommCoreModuleSchemaCxxSpecJSI {\n- const int codeVersion{138};\n+ const int codeVersion{139};\nstd::unique_ptr<WorkerThread> databaseThread;\nstd::unique_ptr<WorkerThread> cryptoThread;\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.debug.plist", "new_path": "native/ios/Comm/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.138</string>\n+ <string>1.0.139</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>138</string>\n+ <string>139</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.release.plist", "new_path": "native/ios/Comm/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.138</string>\n+ <string>1.0.139</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>138</string>\n+ <string>139</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] `codeVersion` -> 139
129,184
31.07.2022 16:25:16
14,400
0fd0b76d220c924b796b5a1585150f2341b466e8
[yarn] Move `gaxios` dependency from `native` to root `package.json` Summary: So that the `gaxios` dependency can be resolved from `comm/scripts/generate-phab-tag-removal-script.js`. Depends on D4690 Test Plan: CI Reviewers: ashoat, tomek, jacek, abosh Subscribers: adrian
[ { "change_type": "MODIFY", "old_path": "native/package.json", "new_path": "native/package.json", "diff": "\"flow-mono-cli\": \"^1.5.0\",\n\"flow-typed\": \"^3.2.1\",\n\"fs-extra\": \"^8.1.0\",\n- \"gaxios\": \"^4.3.2\",\n\"googleapis\": \"^89.0.0\",\n\"jest\": \"^26.6.3\",\n\"jetifier\": \"^1.6.4\",\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "\"eslint-plugin-react\": \"^7.22.0\",\n\"eslint-plugin-react-hooks\": \"^4.2.0\",\n\"eslint-plugin-react-native\": \"^3.10.0\",\n+ \"gaxios\": \"^4.3.2\",\n\"husky\": \"^7.0.0\",\n\"lint-staged\": \"^12.1.4\",\n\"prettier\": \"^2.1.2\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[yarn] Move `gaxios` dependency from `native` to root `package.json` Summary: So that the `gaxios` dependency can be resolved from `comm/scripts/generate-phab-tag-removal-script.js`. --- Depends on D4690 Test Plan: CI Reviewers: ashoat, tomek, jacek, abosh Reviewed By: ashoat Subscribers: adrian Differential Revision: https://phab.comm.dev/D4691
129,184
01.08.2022 13:53:40
14,400
cb7c1681b3ffe584c2e9a6988e126dd277581b3d
[native] `codeVersion` -> 140
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -434,8 +434,8 @@ android {\napplicationId 'app.comm.android'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 139\n- versionName '1.0.139'\n+ versionCode 140\n+ versionName '1.0.140'\nmissingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "new_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "diff": "@@ -13,7 +13,7 @@ namespace comm {\nnamespace jsi = facebook::jsi;\nclass CommCoreModule : public facebook::react::CommCoreModuleSchemaCxxSpecJSI {\n- const int codeVersion{139};\n+ const int codeVersion{140};\nstd::unique_ptr<WorkerThread> databaseThread;\nstd::unique_ptr<WorkerThread> cryptoThread;\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.debug.plist", "new_path": "native/ios/Comm/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.139</string>\n+ <string>1.0.140</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>139</string>\n+ <string>140</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.release.plist", "new_path": "native/ios/Comm/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.139</string>\n+ <string>1.0.140</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>139</string>\n+ <string>140</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] `codeVersion` -> 140
129,190
20.07.2022 12:26:29
-7,200
b525823ae3e2c0abf8d9a6b203cfd1314d24ad6e
[services] Tests - Add REMOVE for Blob performance tests Summary: Depends on D4583 Adding the logic for the `remove` operations. Test Plan: ``` cd services yarn run-performance-tests blob ``` Reviewers: tomek, varun Subscribers: ashoat, tomek, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "services/commtest/tests/blob_performance_test.rs", "new_path": "services/commtest/tests/blob_performance_test.rs", "diff": "@@ -4,6 +4,8 @@ mod blob_utils;\nmod get;\n#[path = \"./blob/put.rs\"]\nmod put;\n+#[path = \"./blob/remove.rs\"]\n+mod remove;\n#[path = \"./lib/tools.rs\"]\nmod tools;\n@@ -95,6 +97,23 @@ async fn blob_performance_test() -> Result<(), Error> {\n// REMOVE\nrt.block_on(async {\nprintln!(\"performing REMOVE operations\");\n+ let mut handlers = vec![];\n+\n+ for item in &blob_data {\n+ let item_cloned = item.clone();\n+ let mut client_cloned = client.clone();\n+ handlers.push(tokio::spawn(async move {\n+ remove::run(&mut client_cloned, &item_cloned).await.unwrap();\n+ assert!(\n+ get::run(&mut client_cloned, &item_cloned).await.is_err(),\n+ \"item should no longer be available\"\n+ );\n+ }));\n+ }\n+\n+ for handler in handlers {\n+ handler.await.unwrap();\n+ }\n});\n})\n.await\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Tests - Add REMOVE for Blob performance tests Summary: Depends on D4583 Adding the logic for the `remove` operations. Test Plan: ``` cd services yarn run-performance-tests blob ``` Reviewers: tomek, varun Reviewed By: tomek Subscribers: ashoat, tomek, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4584
129,190
26.07.2022 11:48:29
-7,200
21ab868fa7bc2625e3c1d2954f0e6ef4e448b3b2
[services] Tests - Backup - Create new backup Summary: Depends on D4631 Adding a piece of test for "add attachments for backup" functionality. Test Plan: ``` cd services yarn run-performance-tests backup 1 ``` Reviewers: tomek, varun Subscribers: ashoat, tomek, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "services/commtest/tests/backup_performance_test.rs", "new_path": "services/commtest/tests/backup_performance_test.rs", "diff": "#[path = \"./backup/backup_utils.rs\"]\nmod backup_utils;\n+#[path = \"./backup/create_new_backup.rs\"]\n+mod create_new_backup;\n#[path = \"./lib/tools.rs\"]\nmod tools;\nuse bytesize::ByteSize;\n+use std::env;\n+use std::sync::mpsc::channel;\n+use tokio::runtime::Runtime;\nuse tools::{obtain_number_of_threads, Error};\n-use backup_utils::{BackupData, Item};\n+use backup_utils::{BackupData, BackupServiceClient, Item};\n#[tokio::test]\nasync fn backup_performance_test() -> Result<(), Error> {\n+ let port = env::var(\"COMM_SERVICES_PORT_BACKUP\")\n+ .expect(\"port env var expected but not received\");\n+ let client =\n+ BackupServiceClient::connect(format!(\"http://localhost:{}\", port)).await?;\n+\nlet number_of_threads = obtain_number_of_threads();\nprintln!(\n@@ -41,8 +51,49 @@ async fn backup_performance_test() -> Result<(), Error> {\n});\n}\n+ let rt = Runtime::new().unwrap();\ntokio::task::spawn_blocking(move || {\n// CREATE NEW BACKUP\n+ rt.block_on(async {\n+ println!(\"performing CREATE NEW BACKUP operations\");\n+ let mut handlers = vec![];\n+ let (sender, receiver) = channel::<(usize, String)>();\n+ for (i, item) in backup_data.iter().enumerate() {\n+ let item_cloned = item.clone();\n+ let mut client_cloned = client.clone();\n+ let sender_cloned = sender.clone();\n+ handlers.push(tokio::spawn(async move {\n+ let id = create_new_backup::run(&mut client_cloned, &item_cloned)\n+ .await\n+ .unwrap();\n+ assert!(\n+ !id.is_empty(),\n+ \"backup id should not be empty after creating a new backup\"\n+ );\n+ sender_cloned.send((i, id)).unwrap();\n+ }));\n+ }\n+ drop(sender);\n+\n+ for handler in handlers {\n+ handler.await.unwrap();\n+ }\n+ for data in receiver {\n+ println!(\"received: {:?}\", data);\n+ let (index, id) = data;\n+ backup_data[index].backup_item.id = id;\n+ }\n+ });\n+\n+ // check if backup IDs are properly set\n+ for (i, item) in backup_data.iter().enumerate() {\n+ assert!(\n+ !item.backup_item.id.is_empty(),\n+ \"missing backup id for index {}\",\n+ i\n+ );\n+ }\n+\n// SEND LOG\n// ADD ATTACHMENTS\n// PULL BACKUP\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Tests - Backup - Create new backup Summary: Depends on D4631 Adding a piece of test for "add attachments for backup" functionality. Test Plan: ``` cd services yarn run-performance-tests backup 1 ``` Reviewers: tomek, varun Reviewed By: tomek Subscribers: ashoat, tomek, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4637
129,190
25.07.2022 13:10:39
-7,200
0971023d31cb7ce4f58fb8023960cf8ff217a99b
[services] Tests - Backup - Add attachments for backups Summary: Depends on D4637 Adding a piece of test for "add attachments for backup" functionality. Test Plan: ``` cd services yarn run-performance-tests backup 1 ``` Reviewers: tomek, varun Subscribers: ashoat, tomek, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "services/commtest/tests/backup_performance_test.rs", "new_path": "services/commtest/tests/backup_performance_test.rs", "diff": "+#[path = \"./backup/add_attachments.rs\"]\n+mod add_attachments;\n#[path = \"./backup/backup_utils.rs\"]\nmod backup_utils;\n#[path = \"./backup/create_new_backup.rs\"]\n@@ -94,6 +96,27 @@ async fn backup_performance_test() -> Result<(), Error> {\n);\n}\n+ // ADD ATTACHMENTS - BACKUPS\n+ rt.block_on(async {\n+ println!(\"performing ADD ATTACHMENTS - BACKUPS operations\");\n+ let mut handlers = vec![];\n+ for item in backup_data {\n+ let item_cloned = item.clone();\n+ let mut client_cloned = client.clone();\n+ handlers.push(tokio::spawn(async move {\n+ if !item_cloned.backup_item.attachments_holders.is_empty() {\n+ add_attachments::run(&mut client_cloned, &item_cloned, None)\n+ .await\n+ .unwrap();\n+ }\n+ }));\n+ }\n+\n+ for handler in handlers {\n+ handler.await.unwrap();\n+ }\n+ });\n+\n// SEND LOG\n// ADD ATTACHMENTS\n// PULL BACKUP\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Tests - Backup - Add attachments for backups Summary: Depends on D4637 Adding a piece of test for "add attachments for backup" functionality. Test Plan: ``` cd services yarn run-performance-tests backup 1 ``` Reviewers: tomek, varun Reviewed By: tomek Subscribers: ashoat, tomek, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4632
129,190
25.07.2022 13:11:56
-7,200
6896bb4bb392966602d0f62c01d96a6615443740
[services] Tests - Backup - Send log Summary: Depends on D4632 Adding a piece of test for "send log" functionality. Test Plan: ``` cd services yarn run-performance-tests backup 1 ``` Reviewers: tomek, varun Subscribers: ashoat, tomek, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "services/commtest/tests/backup_performance_test.rs", "new_path": "services/commtest/tests/backup_performance_test.rs", "diff": "@@ -4,6 +4,8 @@ mod add_attachments;\nmod backup_utils;\n#[path = \"./backup/create_new_backup.rs\"]\nmod create_new_backup;\n+#[path = \"./backup/send_log.rs\"]\n+mod send_log;\n#[path = \"./lib/tools.rs\"]\nmod tools;\n@@ -75,6 +77,11 @@ async fn backup_performance_test() -> Result<(), Error> {\nsender_cloned.send((i, id)).unwrap();\n}));\n}\n+ // https://docs.rs/tokio/1.1.0/tokio/sync/mpsc/struct.Receiver.html#method.recv\n+ // The channel is closed when all senders have been dropped, or when close\n+ // is called. The best option here is to clone the sender for every\n+ // thread, drop the original one and let all the clones be dropped when\n+ // going out of scope which is equal to the parent thread's termination.\ndrop(sender);\nfor handler in handlers {\n@@ -118,6 +125,62 @@ async fn backup_performance_test() -> Result<(), Error> {\n});\n// SEND LOG\n+ rt.block_on(async {\n+ println!(\"performing SEND LOG operations\");\n+ let mut handlers = vec![];\n+ let (sender, receiver) = channel::<(usize, usize, String)>();\n+ for (backup_index, backup_item) in backup_data.iter().enumerate() {\n+ let backup_item_cloned = backup_item.clone();\n+ for log_index in 0..backup_item_cloned.log_items.len() {\n+ let backup_item_recloned = backup_item_cloned.clone();\n+ let mut client_cloned = client.clone();\n+ let sender_cloned = sender.clone();\n+ handlers.push(tokio::spawn(async move {\n+ println!(\n+ \"sending log, backup index: [{}] log index: [{}]\",\n+ backup_index, log_index\n+ );\n+ let id = send_log::run(\n+ &mut client_cloned,\n+ &backup_item_recloned,\n+ log_index,\n+ )\n+ .await\n+ .unwrap();\n+ assert!(!id.is_empty(), \"log id should not be empty after sending\");\n+ sender_cloned.send((backup_index, log_index, id)).unwrap();\n+ }));\n+ }\n+ }\n+ // https://docs.rs/tokio/1.1.0/tokio/sync/mpsc/struct.Receiver.html#method.recv\n+ // The channel is closed when all senders have been dropped, or when close\n+ // is called. The best option here is to clone the sender for every\n+ // thread, drop the original one and let all the clones be dropped when\n+ // going out of scope which is equal to the parent thread's termination.\n+ drop(sender);\n+\n+ for handler in handlers {\n+ handler.await.unwrap();\n+ }\n+ for data in receiver {\n+ println!(\"received: {:?}\", data);\n+ let (backup_index, log_index, id) = data;\n+ backup_data[backup_index].log_items[log_index].id = id;\n+ }\n+ });\n+\n+ // check if log IDs are properly set\n+ for (backup_index, backup_item) in backup_data.iter().enumerate() {\n+ for (log_index, log_item) in backup_item.log_items.iter().enumerate() {\n+ assert!(\n+ !log_item.id.is_empty(),\n+ \"missing log id for backup index {} and log index {}\",\n+ backup_index,\n+ log_index\n+ );\n+ }\n+ }\n+\n// ADD ATTACHMENTS\n// PULL BACKUP\n})\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Tests - Backup - Send log Summary: Depends on D4632 Adding a piece of test for "send log" functionality. Test Plan: ``` cd services yarn run-performance-tests backup 1 ``` Reviewers: tomek, varun Reviewed By: tomek, varun Subscribers: ashoat, tomek, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4633
129,190
25.07.2022 14:26:23
-7,200
48a8514485d44fe5164a3bd24a8a2a2f0bf2ddda
[services] Tests - Backup - Add attachments for logs Summary: Depends on D4633 Adding a piece of test for "add attachments for logs" functionality. Test Plan: ``` cd services yarn run-performance-tests backup 1 ``` Reviewers: tomek, varun Subscribers: ashoat, tomek, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "services/commtest/tests/backup_performance_test.rs", "new_path": "services/commtest/tests/backup_performance_test.rs", "diff": "@@ -107,7 +107,7 @@ async fn backup_performance_test() -> Result<(), Error> {\nrt.block_on(async {\nprintln!(\"performing ADD ATTACHMENTS - BACKUPS operations\");\nlet mut handlers = vec![];\n- for item in backup_data {\n+ for item in &backup_data {\nlet item_cloned = item.clone();\nlet mut client_cloned = client.clone();\nhandlers.push(tokio::spawn(async move {\n@@ -181,7 +181,38 @@ async fn backup_performance_test() -> Result<(), Error> {\n}\n}\n- // ADD ATTACHMENTS\n+ // ADD ATTACHMENTS - LOGS\n+ rt.block_on(async {\n+ println!(\"performing ADD ATTACHMENTS - LOGS operations\");\n+ let mut handlers = vec![];\n+ for backup_item in &backup_data {\n+ let backup_item_cloned = backup_item.clone();\n+ for log_index in 0..backup_item_cloned.log_items.len() {\n+ let backup_item_recloned = backup_item_cloned.clone();\n+ let mut client_cloned = client.clone();\n+ handlers.push(tokio::spawn(async move {\n+ if !backup_item_recloned\n+ .backup_item\n+ .attachments_holders\n+ .is_empty()\n+ {\n+ add_attachments::run(\n+ &mut client_cloned,\n+ &backup_item_recloned,\n+ Some(log_index),\n+ )\n+ .await\n+ .unwrap();\n+ }\n+ }));\n+ }\n+ }\n+\n+ for handler in handlers {\n+ handler.await.unwrap();\n+ }\n+ });\n+\n// PULL BACKUP\n})\n.await\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Tests - Backup - Add attachments for logs Summary: Depends on D4633 Adding a piece of test for "add attachments for logs" functionality. Test Plan: ``` cd services yarn run-performance-tests backup 1 ``` Reviewers: tomek, varun Reviewed By: tomek, varun Subscribers: ashoat, tomek, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4634
129,190
25.07.2022 14:46:34
-7,200
4100487108b30f6698add6ecc0944d2e946f16f8
[services] Tests - Backup - Pull backup Summary: Depends on D4635 Adding a piece of test for "pull backup" functionality. Test Plan: ``` cd services yarn run-performance-tests backup 1 ``` Reviewers: tomek, varun Subscribers: ashoat, tomek, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "services/commtest/tests/backup_performance_test.rs", "new_path": "services/commtest/tests/backup_performance_test.rs", "diff": "@@ -4,6 +4,8 @@ mod add_attachments;\nmod backup_utils;\n#[path = \"./backup/create_new_backup.rs\"]\nmod create_new_backup;\n+#[path = \"./backup/pull_backup.rs\"]\n+mod pull_backup;\n#[path = \"./backup/send_log.rs\"]\nmod send_log;\n#[path = \"./lib/tools.rs\"]\n@@ -214,6 +216,24 @@ async fn backup_performance_test() -> Result<(), Error> {\n});\n// PULL BACKUP\n+ rt.block_on(async {\n+ println!(\"performing PULL BACKUP operations\");\n+ let mut handlers = vec![];\n+ for item in backup_data {\n+ let item_cloned = item.clone();\n+ let mut client_cloned = client.clone();\n+ handlers.push(tokio::spawn(async move {\n+ let result = pull_backup::run(&mut client_cloned, &item_cloned)\n+ .await\n+ .unwrap();\n+ backup_utils::compare_backups(&item_cloned, &result);\n+ }));\n+ }\n+\n+ for handler in handlers {\n+ handler.await.unwrap();\n+ }\n+ });\n})\n.await\n.expect(\"Task panicked\");\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Tests - Backup - Pull backup Summary: Depends on D4635 Adding a piece of test for "pull backup" functionality. Test Plan: ``` cd services yarn run-performance-tests backup 1 ``` Reviewers: tomek, varun Reviewed By: tomek Subscribers: ashoat, tomek, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4636
129,190
02.08.2022 12:04:36
-7,200
3801e446e5eda2dacb1e4275a6d7d31cba746758
[services] Blob - PullBackupReactor - Simplify write response logic Summary: Depends on D4649 I spotted that there's a redundant call of `prepareDataChunkWithPadding` and the logic of the `PullBackupReactor::writeResponse` can be simplified. Test Plan: ``` cd services yarn run-backup-service-in-sandbox ``` Reviewers: tomek Subscribers: ashoat, tomek, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "services/backup/src/Reactors/server/PullBackupReactor.cpp", "new_path": "services/backup/src/Reactors/server/PullBackupReactor.cpp", "diff": "@@ -164,10 +164,7 @@ PullBackupReactor::writeResponse(backup::PullBackupResponse *response) {\n// If there's data inside, we write it to the client and proceed.\nif (dataChunk.empty()) {\nthis->nextLog();\n- return nullptr;\n} else {\n- dataChunk =\n- this->prepareDataChunkWithPadding(dataChunk, extraBytesNeeded);\nresponse->set_logchunk(dataChunk);\n}\nreturn nullptr;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Blob - PullBackupReactor - Simplify write response logic Summary: Depends on D4649 I spotted that there's a redundant call of `prepareDataChunkWithPadding` and the logic of the `PullBackupReactor::writeResponse` can be simplified. Test Plan: ``` cd services yarn run-backup-service-in-sandbox ``` Reviewers: tomek Reviewed By: tomek Subscribers: ashoat, tomek, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4651
129,200
29.07.2022 14:20:01
14,400
5d4131ef61ab63421ee642ba37c9ed12f625e8b9
[native] rust project for native gRPC client Summary: set up the Cargo project with some obvious dependencies Test Plan: cargo build Reviewers: tomek, karol, ashoat Subscribers: ashoat, adrian, atul, abosh
[ { "change_type": "ADD", "old_path": null, "new_path": "native/cpp/CommonCpp/grpc/grpc_client/Cargo.lock", "diff": "+# This file is automatically @generated by Cargo.\n+# It is not intended for manual editing.\n+version = 3\n+\n+[[package]]\n+name = \"anyhow\"\n+version = \"1.0.58\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"bb07d2053ccdbe10e2af2995a2f116c1330396493dc1269f6a91d0ae82e19704\"\n+\n+[[package]]\n+name = \"async-stream\"\n+version = \"0.3.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e\"\n+dependencies = [\n+ \"async-stream-impl\",\n+ \"futures-core\",\n+]\n+\n+[[package]]\n+name = \"async-stream-impl\"\n+version = \"0.3.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27\"\n+dependencies = [\n+ \"proc-macro2\",\n+ \"quote\",\n+ \"syn\",\n+]\n+\n+[[package]]\n+name = \"async-trait\"\n+version = \"0.1.56\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716\"\n+dependencies = [\n+ \"proc-macro2\",\n+ \"quote\",\n+ \"syn\",\n+]\n+\n+[[package]]\n+name = \"autocfg\"\n+version = \"1.1.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa\"\n+\n+[[package]]\n+name = \"axum\"\n+version = \"0.5.13\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"6b9496f0c1d1afb7a2af4338bbe1d969cddfead41d87a9fb3aaa6d0bbc7af648\"\n+dependencies = [\n+ \"async-trait\",\n+ \"axum-core\",\n+ \"bitflags\",\n+ \"bytes\",\n+ \"futures-util\",\n+ \"http\",\n+ \"http-body\",\n+ \"hyper\",\n+ \"itoa\",\n+ \"matchit\",\n+ \"memchr\",\n+ \"mime\",\n+ \"percent-encoding\",\n+ \"pin-project-lite\",\n+ \"serde\",\n+ \"sync_wrapper\",\n+ \"tokio\",\n+ \"tower\",\n+ \"tower-http\",\n+ \"tower-layer\",\n+ \"tower-service\",\n+]\n+\n+[[package]]\n+name = \"axum-core\"\n+version = \"0.2.7\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"e4f44a0e6200e9d11a1cdc989e4b358f6e3d354fbf48478f345a17f4e43f8635\"\n+dependencies = [\n+ \"async-trait\",\n+ \"bytes\",\n+ \"futures-util\",\n+ \"http\",\n+ \"http-body\",\n+ \"mime\",\n+]\n+\n+[[package]]\n+name = \"base64\"\n+version = \"0.13.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd\"\n+\n+[[package]]\n+name = \"bitflags\"\n+version = \"1.3.2\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a\"\n+\n+[[package]]\n+name = \"bytes\"\n+version = \"1.2.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"f0b3de4a0c5e67e16066a0715723abd91edc2f9001d09c46e1dca929351e130e\"\n+\n+[[package]]\n+name = \"cc\"\n+version = \"1.0.73\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11\"\n+\n+[[package]]\n+name = \"cfg-if\"\n+version = \"1.0.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd\"\n+\n+[[package]]\n+name = \"codespan-reporting\"\n+version = \"0.11.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e\"\n+dependencies = [\n+ \"termcolor\",\n+ \"unicode-width\",\n+]\n+\n+[[package]]\n+name = \"cxx\"\n+version = \"1.0.72\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"b7c14d679239b1ccaad7acaf972a19b41b6c1d7a8cb942158294b4f11ec71bd8\"\n+dependencies = [\n+ \"cc\",\n+ \"cxxbridge-flags\",\n+ \"cxxbridge-macro\",\n+ \"link-cplusplus\",\n+]\n+\n+[[package]]\n+name = \"cxx-build\"\n+version = \"1.0.72\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"0fdbee15c52b8d9132c62c341d2046885717e4a180eb9d3cd34c5a78f2669257\"\n+dependencies = [\n+ \"cc\",\n+ \"codespan-reporting\",\n+ \"once_cell\",\n+ \"proc-macro2\",\n+ \"quote\",\n+ \"scratch\",\n+ \"syn\",\n+]\n+\n+[[package]]\n+name = \"cxxbridge-flags\"\n+version = \"1.0.72\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"2fdfa84261f05a9b69c0afe03270f9f26d6899ca7df6f442563908b646e8a376\"\n+\n+[[package]]\n+name = \"cxxbridge-macro\"\n+version = \"1.0.72\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"0269826813dfbda75223169c774fede73401793e9af3970e4edbe93879782c1d\"\n+dependencies = [\n+ \"proc-macro2\",\n+ \"quote\",\n+ \"syn\",\n+]\n+\n+[[package]]\n+name = \"either\"\n+version = \"1.7.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be\"\n+\n+[[package]]\n+name = \"fastrand\"\n+version = \"1.8.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499\"\n+dependencies = [\n+ \"instant\",\n+]\n+\n+[[package]]\n+name = \"fixedbitset\"\n+version = \"0.4.2\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80\"\n+\n+[[package]]\n+name = \"fnv\"\n+version = \"1.0.7\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1\"\n+\n+[[package]]\n+name = \"futures-channel\"\n+version = \"0.3.21\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010\"\n+dependencies = [\n+ \"futures-core\",\n+]\n+\n+[[package]]\n+name = \"futures-core\"\n+version = \"0.3.21\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3\"\n+\n+[[package]]\n+name = \"futures-sink\"\n+version = \"0.3.21\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868\"\n+\n+[[package]]\n+name = \"futures-task\"\n+version = \"0.3.21\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a\"\n+\n+[[package]]\n+name = \"futures-util\"\n+version = \"0.3.21\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a\"\n+dependencies = [\n+ \"futures-core\",\n+ \"futures-task\",\n+ \"pin-project-lite\",\n+ \"pin-utils\",\n+]\n+\n+[[package]]\n+name = \"getrandom\"\n+version = \"0.2.7\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6\"\n+dependencies = [\n+ \"cfg-if\",\n+ \"libc\",\n+ \"wasi\",\n+]\n+\n+[[package]]\n+name = \"grpc_client\"\n+version = \"0.1.0\"\n+dependencies = [\n+ \"cxx\",\n+ \"cxx-build\",\n+ \"lazy_static\",\n+ \"prost\",\n+ \"tokio\",\n+ \"tokio-stream\",\n+ \"tonic\",\n+ \"tonic-build\",\n+]\n+\n+[[package]]\n+name = \"h2\"\n+version = \"0.3.13\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57\"\n+dependencies = [\n+ \"bytes\",\n+ \"fnv\",\n+ \"futures-core\",\n+ \"futures-sink\",\n+ \"futures-util\",\n+ \"http\",\n+ \"indexmap\",\n+ \"slab\",\n+ \"tokio\",\n+ \"tokio-util\",\n+ \"tracing\",\n+]\n+\n+[[package]]\n+name = \"hashbrown\"\n+version = \"0.12.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888\"\n+\n+[[package]]\n+name = \"heck\"\n+version = \"0.4.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9\"\n+\n+[[package]]\n+name = \"hermit-abi\"\n+version = \"0.1.19\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33\"\n+dependencies = [\n+ \"libc\",\n+]\n+\n+[[package]]\n+name = \"http\"\n+version = \"0.2.8\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399\"\n+dependencies = [\n+ \"bytes\",\n+ \"fnv\",\n+ \"itoa\",\n+]\n+\n+[[package]]\n+name = \"http-body\"\n+version = \"0.4.5\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1\"\n+dependencies = [\n+ \"bytes\",\n+ \"http\",\n+ \"pin-project-lite\",\n+]\n+\n+[[package]]\n+name = \"http-range-header\"\n+version = \"0.3.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29\"\n+\n+[[package]]\n+name = \"httparse\"\n+version = \"1.7.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c\"\n+\n+[[package]]\n+name = \"httpdate\"\n+version = \"1.0.2\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421\"\n+\n+[[package]]\n+name = \"hyper\"\n+version = \"0.14.20\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac\"\n+dependencies = [\n+ \"bytes\",\n+ \"futures-channel\",\n+ \"futures-core\",\n+ \"futures-util\",\n+ \"h2\",\n+ \"http\",\n+ \"http-body\",\n+ \"httparse\",\n+ \"httpdate\",\n+ \"itoa\",\n+ \"pin-project-lite\",\n+ \"socket2\",\n+ \"tokio\",\n+ \"tower-service\",\n+ \"tracing\",\n+ \"want\",\n+]\n+\n+[[package]]\n+name = \"hyper-timeout\"\n+version = \"0.4.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1\"\n+dependencies = [\n+ \"hyper\",\n+ \"pin-project-lite\",\n+ \"tokio\",\n+ \"tokio-io-timeout\",\n+]\n+\n+[[package]]\n+name = \"indexmap\"\n+version = \"1.9.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e\"\n+dependencies = [\n+ \"autocfg\",\n+ \"hashbrown\",\n+]\n+\n+[[package]]\n+name = \"instant\"\n+version = \"0.1.12\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c\"\n+dependencies = [\n+ \"cfg-if\",\n+]\n+\n+[[package]]\n+name = \"itertools\"\n+version = \"0.10.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3\"\n+dependencies = [\n+ \"either\",\n+]\n+\n+[[package]]\n+name = \"itoa\"\n+version = \"1.0.2\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d\"\n+\n+[[package]]\n+name = \"lazy_static\"\n+version = \"1.4.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646\"\n+\n+[[package]]\n+name = \"libc\"\n+version = \"0.2.126\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836\"\n+\n+[[package]]\n+name = \"link-cplusplus\"\n+version = \"1.0.6\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"f8cae2cd7ba2f3f63938b9c724475dfb7b9861b545a90324476324ed21dbc8c8\"\n+dependencies = [\n+ \"cc\",\n+]\n+\n+[[package]]\n+name = \"log\"\n+version = \"0.4.17\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e\"\n+dependencies = [\n+ \"cfg-if\",\n+]\n+\n+[[package]]\n+name = \"matchit\"\n+version = \"0.5.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb\"\n+\n+[[package]]\n+name = \"memchr\"\n+version = \"2.5.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d\"\n+\n+[[package]]\n+name = \"mime\"\n+version = \"0.3.16\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d\"\n+\n+[[package]]\n+name = \"mio\"\n+version = \"0.8.4\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf\"\n+dependencies = [\n+ \"libc\",\n+ \"log\",\n+ \"wasi\",\n+ \"windows-sys\",\n+]\n+\n+[[package]]\n+name = \"multimap\"\n+version = \"0.8.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a\"\n+\n+[[package]]\n+name = \"num_cpus\"\n+version = \"1.13.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1\"\n+dependencies = [\n+ \"hermit-abi\",\n+ \"libc\",\n+]\n+\n+[[package]]\n+name = \"once_cell\"\n+version = \"1.13.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1\"\n+\n+[[package]]\n+name = \"percent-encoding\"\n+version = \"2.1.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e\"\n+\n+[[package]]\n+name = \"petgraph\"\n+version = \"0.6.2\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143\"\n+dependencies = [\n+ \"fixedbitset\",\n+ \"indexmap\",\n+]\n+\n+[[package]]\n+name = \"pin-project\"\n+version = \"1.0.11\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260\"\n+dependencies = [\n+ \"pin-project-internal\",\n+]\n+\n+[[package]]\n+name = \"pin-project-internal\"\n+version = \"1.0.11\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"710faf75e1b33345361201d36d04e98ac1ed8909151a017ed384700836104c74\"\n+dependencies = [\n+ \"proc-macro2\",\n+ \"quote\",\n+ \"syn\",\n+]\n+\n+[[package]]\n+name = \"pin-project-lite\"\n+version = \"0.2.9\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116\"\n+\n+[[package]]\n+name = \"pin-utils\"\n+version = \"0.1.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184\"\n+\n+[[package]]\n+name = \"ppv-lite86\"\n+version = \"0.2.16\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872\"\n+\n+[[package]]\n+name = \"prettyplease\"\n+version = \"0.1.17\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"fffbe84bf1905c007253d1f10ffb85fbc8ca8624a40cff8f2ded6f36920e38e0\"\n+dependencies = [\n+ \"proc-macro2\",\n+ \"syn\",\n+]\n+\n+[[package]]\n+name = \"proc-macro2\"\n+version = \"1.0.42\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"c278e965f1d8cf32d6e0e96de3d3e79712178ae67986d9cf9151f51e95aac89b\"\n+dependencies = [\n+ \"unicode-ident\",\n+]\n+\n+[[package]]\n+name = \"prost\"\n+version = \"0.11.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"399c3c31cdec40583bb68f0b18403400d01ec4289c383aa047560439952c4dd7\"\n+dependencies = [\n+ \"bytes\",\n+ \"prost-derive\",\n+]\n+\n+[[package]]\n+name = \"prost-build\"\n+version = \"0.11.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"d49d928704208aba2cb1fb022ce1a319bdedcb03caf51ddf82734fa903407762\"\n+dependencies = [\n+ \"bytes\",\n+ \"heck\",\n+ \"itertools\",\n+ \"lazy_static\",\n+ \"log\",\n+ \"multimap\",\n+ \"petgraph\",\n+ \"prost\",\n+ \"prost-types\",\n+ \"regex\",\n+ \"tempfile\",\n+ \"which\",\n+]\n+\n+[[package]]\n+name = \"prost-derive\"\n+version = \"0.11.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"7345d5f0e08c0536d7ac7229952590239e77abf0a0100a1b1d890add6ea96364\"\n+dependencies = [\n+ \"anyhow\",\n+ \"itertools\",\n+ \"proc-macro2\",\n+ \"quote\",\n+ \"syn\",\n+]\n+\n+[[package]]\n+name = \"prost-types\"\n+version = \"0.11.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"d30bc806a29b347314be074ff0608ef8e547286e8ea68b061a2fe55689edc01f\"\n+dependencies = [\n+ \"bytes\",\n+ \"prost\",\n+]\n+\n+[[package]]\n+name = \"quote\"\n+version = \"1.0.20\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804\"\n+dependencies = [\n+ \"proc-macro2\",\n+]\n+\n+[[package]]\n+name = \"rand\"\n+version = \"0.8.5\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404\"\n+dependencies = [\n+ \"libc\",\n+ \"rand_chacha\",\n+ \"rand_core\",\n+]\n+\n+[[package]]\n+name = \"rand_chacha\"\n+version = \"0.3.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88\"\n+dependencies = [\n+ \"ppv-lite86\",\n+ \"rand_core\",\n+]\n+\n+[[package]]\n+name = \"rand_core\"\n+version = \"0.6.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7\"\n+dependencies = [\n+ \"getrandom\",\n+]\n+\n+[[package]]\n+name = \"redox_syscall\"\n+version = \"0.2.16\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a\"\n+dependencies = [\n+ \"bitflags\",\n+]\n+\n+[[package]]\n+name = \"regex\"\n+version = \"1.6.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b\"\n+dependencies = [\n+ \"regex-syntax\",\n+]\n+\n+[[package]]\n+name = \"regex-syntax\"\n+version = \"0.6.27\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244\"\n+\n+[[package]]\n+name = \"remove_dir_all\"\n+version = \"0.5.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7\"\n+dependencies = [\n+ \"winapi\",\n+]\n+\n+[[package]]\n+name = \"scratch\"\n+version = \"1.0.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"96311ef4a16462c757bb6a39152c40f58f31cd2602a40fceb937e2bc34e6cbab\"\n+\n+[[package]]\n+name = \"serde\"\n+version = \"1.0.141\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"7af873f2c95b99fcb0bd0fe622a43e29514658873c8ceba88c4cb88833a22500\"\n+\n+[[package]]\n+name = \"slab\"\n+version = \"0.4.7\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef\"\n+dependencies = [\n+ \"autocfg\",\n+]\n+\n+[[package]]\n+name = \"socket2\"\n+version = \"0.4.4\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0\"\n+dependencies = [\n+ \"libc\",\n+ \"winapi\",\n+]\n+\n+[[package]]\n+name = \"syn\"\n+version = \"1.0.98\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd\"\n+dependencies = [\n+ \"proc-macro2\",\n+ \"quote\",\n+ \"unicode-ident\",\n+]\n+\n+[[package]]\n+name = \"sync_wrapper\"\n+version = \"0.1.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8\"\n+\n+[[package]]\n+name = \"tempfile\"\n+version = \"3.3.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4\"\n+dependencies = [\n+ \"cfg-if\",\n+ \"fastrand\",\n+ \"libc\",\n+ \"redox_syscall\",\n+ \"remove_dir_all\",\n+ \"winapi\",\n+]\n+\n+[[package]]\n+name = \"termcolor\"\n+version = \"1.1.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755\"\n+dependencies = [\n+ \"winapi-util\",\n+]\n+\n+[[package]]\n+name = \"tokio\"\n+version = \"1.20.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581\"\n+dependencies = [\n+ \"autocfg\",\n+ \"bytes\",\n+ \"libc\",\n+ \"memchr\",\n+ \"mio\",\n+ \"num_cpus\",\n+ \"once_cell\",\n+ \"pin-project-lite\",\n+ \"socket2\",\n+ \"tokio-macros\",\n+ \"winapi\",\n+]\n+\n+[[package]]\n+name = \"tokio-io-timeout\"\n+version = \"1.2.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf\"\n+dependencies = [\n+ \"pin-project-lite\",\n+ \"tokio\",\n+]\n+\n+[[package]]\n+name = \"tokio-macros\"\n+version = \"1.8.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484\"\n+dependencies = [\n+ \"proc-macro2\",\n+ \"quote\",\n+ \"syn\",\n+]\n+\n+[[package]]\n+name = \"tokio-stream\"\n+version = \"0.1.9\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9\"\n+dependencies = [\n+ \"futures-core\",\n+ \"pin-project-lite\",\n+ \"tokio\",\n+]\n+\n+[[package]]\n+name = \"tokio-util\"\n+version = \"0.7.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45\"\n+dependencies = [\n+ \"bytes\",\n+ \"futures-core\",\n+ \"futures-sink\",\n+ \"pin-project-lite\",\n+ \"tokio\",\n+ \"tracing\",\n+]\n+\n+[[package]]\n+name = \"tonic\"\n+version = \"0.8.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"498f271adc46acce75d66f639e4d35b31b2394c295c82496727dafa16d465dd2\"\n+dependencies = [\n+ \"async-stream\",\n+ \"async-trait\",\n+ \"axum\",\n+ \"base64\",\n+ \"bytes\",\n+ \"futures-core\",\n+ \"futures-util\",\n+ \"h2\",\n+ \"http\",\n+ \"http-body\",\n+ \"hyper\",\n+ \"hyper-timeout\",\n+ \"percent-encoding\",\n+ \"pin-project\",\n+ \"prost\",\n+ \"prost-derive\",\n+ \"tokio\",\n+ \"tokio-stream\",\n+ \"tokio-util\",\n+ \"tower\",\n+ \"tower-layer\",\n+ \"tower-service\",\n+ \"tracing\",\n+ \"tracing-futures\",\n+]\n+\n+[[package]]\n+name = \"tonic-build\"\n+version = \"0.8.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"2fbcd2800e34e743b9ae795867d5f77b535d3a3be69fd731e39145719752df8c\"\n+dependencies = [\n+ \"prettyplease\",\n+ \"proc-macro2\",\n+ \"prost-build\",\n+ \"quote\",\n+ \"syn\",\n+]\n+\n+[[package]]\n+name = \"tower\"\n+version = \"0.4.13\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c\"\n+dependencies = [\n+ \"futures-core\",\n+ \"futures-util\",\n+ \"indexmap\",\n+ \"pin-project\",\n+ \"pin-project-lite\",\n+ \"rand\",\n+ \"slab\",\n+ \"tokio\",\n+ \"tokio-util\",\n+ \"tower-layer\",\n+ \"tower-service\",\n+ \"tracing\",\n+]\n+\n+[[package]]\n+name = \"tower-http\"\n+version = \"0.3.4\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"3c530c8675c1dbf98facee631536fa116b5fb6382d7dd6dc1b118d970eafe3ba\"\n+dependencies = [\n+ \"bitflags\",\n+ \"bytes\",\n+ \"futures-core\",\n+ \"futures-util\",\n+ \"http\",\n+ \"http-body\",\n+ \"http-range-header\",\n+ \"pin-project-lite\",\n+ \"tower\",\n+ \"tower-layer\",\n+ \"tower-service\",\n+]\n+\n+[[package]]\n+name = \"tower-layer\"\n+version = \"0.3.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62\"\n+\n+[[package]]\n+name = \"tower-service\"\n+version = \"0.3.2\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52\"\n+\n+[[package]]\n+name = \"tracing\"\n+version = \"0.1.35\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160\"\n+dependencies = [\n+ \"cfg-if\",\n+ \"log\",\n+ \"pin-project-lite\",\n+ \"tracing-attributes\",\n+ \"tracing-core\",\n+]\n+\n+[[package]]\n+name = \"tracing-attributes\"\n+version = \"0.1.22\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2\"\n+dependencies = [\n+ \"proc-macro2\",\n+ \"quote\",\n+ \"syn\",\n+]\n+\n+[[package]]\n+name = \"tracing-core\"\n+version = \"0.1.28\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7\"\n+dependencies = [\n+ \"once_cell\",\n+]\n+\n+[[package]]\n+name = \"tracing-futures\"\n+version = \"0.2.5\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2\"\n+dependencies = [\n+ \"pin-project\",\n+ \"tracing\",\n+]\n+\n+[[package]]\n+name = \"try-lock\"\n+version = \"0.2.3\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642\"\n+\n+[[package]]\n+name = \"unicode-ident\"\n+version = \"1.0.2\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7\"\n+\n+[[package]]\n+name = \"unicode-width\"\n+version = \"0.1.9\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973\"\n+\n+[[package]]\n+name = \"want\"\n+version = \"0.3.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0\"\n+dependencies = [\n+ \"log\",\n+ \"try-lock\",\n+]\n+\n+[[package]]\n+name = \"wasi\"\n+version = \"0.11.0+wasi-snapshot-preview1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423\"\n+\n+[[package]]\n+name = \"which\"\n+version = \"4.2.5\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae\"\n+dependencies = [\n+ \"either\",\n+ \"lazy_static\",\n+ \"libc\",\n+]\n+\n+[[package]]\n+name = \"winapi\"\n+version = \"0.3.9\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419\"\n+dependencies = [\n+ \"winapi-i686-pc-windows-gnu\",\n+ \"winapi-x86_64-pc-windows-gnu\",\n+]\n+\n+[[package]]\n+name = \"winapi-i686-pc-windows-gnu\"\n+version = \"0.4.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6\"\n+\n+[[package]]\n+name = \"winapi-util\"\n+version = \"0.1.5\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178\"\n+dependencies = [\n+ \"winapi\",\n+]\n+\n+[[package]]\n+name = \"winapi-x86_64-pc-windows-gnu\"\n+version = \"0.4.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f\"\n+\n+[[package]]\n+name = \"windows-sys\"\n+version = \"0.36.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2\"\n+dependencies = [\n+ \"windows_aarch64_msvc\",\n+ \"windows_i686_gnu\",\n+ \"windows_i686_msvc\",\n+ \"windows_x86_64_gnu\",\n+ \"windows_x86_64_msvc\",\n+]\n+\n+[[package]]\n+name = \"windows_aarch64_msvc\"\n+version = \"0.36.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47\"\n+\n+[[package]]\n+name = \"windows_i686_gnu\"\n+version = \"0.36.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6\"\n+\n+[[package]]\n+name = \"windows_i686_msvc\"\n+version = \"0.36.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024\"\n+\n+[[package]]\n+name = \"windows_x86_64_gnu\"\n+version = \"0.36.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1\"\n+\n+[[package]]\n+name = \"windows_x86_64_msvc\"\n+version = \"0.36.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680\"\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/cpp/CommonCpp/grpc/grpc_client/Cargo.toml", "diff": "+[package]\n+name = \"grpc_client\"\n+version = \"0.1.0\"\n+edition = \"2021\"\n+license = \"BSD-3-Clause\"\n+\n+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html\n+\n+[dependencies]\n+cxx = \"1.0\"\n+tokio = { version = \"1.0\", features = [\"macros\", \"rt-multi-thread\"] }\n+tokio-stream = \"0.1\"\n+tonic = \"0.8\"\n+prost = \"0.11\"\n+lazy_static = \"1.4\"\n+\n+[build-dependencies]\n+cxx-build = \"1.0\"\n+tonic-build = \"0.8\"\n" }, { "change_type": "ADD", "old_path": null, "new_path": "native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs", "diff": "+\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] rust project for native gRPC client Summary: set up the Cargo project with some obvious dependencies Test Plan: cargo build Reviewers: tomek, karol, ashoat Reviewed By: tomek, ashoat Subscribers: ashoat, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4683
129,200
01.08.2022 17:30:13
14,400
00e7acfc26064449d7d7d1e23e4ff2a8693965d1
[native] create bridge module and runtime Summary: lazily create a static tokio runtime object that can be passed around for client calls. create the ffi module where library APIs will go. Test Plan: cargo build Reviewers: tomek, karol Subscribers: ashoat, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs", "new_path": "native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs", "diff": "+use lazy_static::lazy_static;\n+use std::sync::Arc;\n+use tokio::runtime::{Builder, Runtime};\npub mod identity {\ntonic::include_proto!(\"identity\");\n}\n+\n+lazy_static! {\n+ pub static ref RUNTIME: Arc<Runtime> = Arc::new(\n+ Builder::new_multi_thread()\n+ .worker_threads(1)\n+ .max_blocking_threads(1)\n+ .enable_all()\n+ .build()\n+ .unwrap()\n+ );\n+}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] create bridge module and runtime Summary: lazily create a static tokio runtime object that can be passed around for client calls. create the ffi module where library APIs will go. Test Plan: cargo build Reviewers: tomek, karol Reviewed By: tomek Subscribers: ashoat, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4707
129,185
03.08.2022 13:22:41
-7,200
e062e97558682487fe30e0fafac3dd6a1489d271
[lib] Introduce shared `getRelationshipDispatchAction` function Summary: Move part of the logic responsible for selecting correct `RelationshipAction` basing on provided `RelationshipButton` to lib so it could be resused on web Test Plan: Confirm the existing logic still worrks on native Reviewers: tomek, atul Subscribers: ashoat, adrian, abosh
[ { "change_type": "MODIFY", "old_path": "lib/shared/relationship-utils.js", "new_path": "lib/shared/relationship-utils.js", "diff": "// @flow\n+import invariant from 'invariant';\n+\nimport {\ntype RelationshipButton,\ntype UserRelationshipStatus,\nuserRelationshipStatus,\nrelationshipButtons,\n+ relationshipActions,\n+ type RelationshipAction,\n} from '../types/relationship-types';\nimport type { UserInfo } from '../types/user-types';\n@@ -51,8 +55,31 @@ function relationshipBlockedInEitherDirection(\n);\n}\n+function getRelationshipDispatchAction(\n+ relationshipButton: RelationshipButton,\n+): RelationshipAction {\n+ if (relationshipButton === relationshipButtons.BLOCK) {\n+ return relationshipActions.BLOCK;\n+ } else if (\n+ relationshipButton === relationshipButtons.FRIEND ||\n+ relationshipButton === relationshipButtons.ACCEPT\n+ ) {\n+ return relationshipActions.FRIEND;\n+ } else if (\n+ relationshipButton === relationshipButtons.UNFRIEND ||\n+ relationshipButton === relationshipButtons.REJECT ||\n+ relationshipButton === relationshipButtons.WITHDRAW\n+ ) {\n+ return relationshipActions.UNFRIEND;\n+ } else if (relationshipButton === relationshipButtons.UNBLOCK) {\n+ return relationshipActions.UNBLOCK;\n+ }\n+ invariant(false, 'relationshipButton conditions should be exhaustive');\n+}\n+\nexport {\nsortIDs,\ngetAvailableRelationshipButtons,\nrelationshipBlockedInEitherDirection,\n+ getRelationshipDispatchAction,\n};\n" }, { "change_type": "MODIFY", "old_path": "native/chat/settings/thread-settings-edit-relationship.react.js", "new_path": "native/chat/settings/thread-settings-edit-relationship.react.js", "diff": "@@ -8,12 +8,12 @@ import {\nupdateRelationships as serverUpdateRelationships,\nupdateRelationshipsActionTypes,\n} from 'lib/actions/relationship-actions';\n+import { getRelationshipDispatchAction } from 'lib/shared/relationship-utils';\nimport { getSingleOtherUser } from 'lib/shared/thread-utils';\nimport {\ntype RelationshipAction,\ntype RelationshipButton,\nrelationshipButtons,\n- relationshipActions,\n} from 'lib/types/relationship-types';\nimport type { ThreadInfo } from 'lib/types/thread-types';\nimport {\n@@ -63,25 +63,10 @@ const ThreadSettingsEditRelationship: React.ComponentType<Props> = React.memo<Pr\n);\nconst { relationshipButton } = props;\n- const relationshipAction = React.useMemo(() => {\n- if (relationshipButton === relationshipButtons.BLOCK) {\n- return relationshipActions.BLOCK;\n- } else if (\n- relationshipButton === relationshipButtons.FRIEND ||\n- relationshipButton === relationshipButtons.ACCEPT\n- ) {\n- return relationshipActions.FRIEND;\n- } else if (\n- relationshipButton === relationshipButtons.UNFRIEND ||\n- relationshipButton === relationshipButtons.REJECT ||\n- relationshipButton === relationshipButtons.WITHDRAW\n- ) {\n- return relationshipActions.UNFRIEND;\n- } else if (relationshipButton === relationshipButtons.UNBLOCK) {\n- return relationshipActions.UNBLOCK;\n- }\n- invariant(false, 'relationshipButton conditions should be exhaustive');\n- }, [relationshipButton]);\n+ const relationshipAction = React.useMemo(\n+ () => getRelationshipDispatchAction(relationshipButton),\n+ [relationshipButton],\n+ );\nconst dispatchActionPromise = useDispatchActionPromise();\nconst onButtonPress = React.useCallback(() => {\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[lib] Introduce shared `getRelationshipDispatchAction` function Summary: Move part of the logic responsible for selecting correct `RelationshipAction` basing on provided `RelationshipButton` to lib so it could be resused on web Test Plan: Confirm the existing logic still worrks on native Reviewers: tomek, atul Reviewed By: tomek Subscribers: ashoat, adrian, abosh Differential Revision: https://phab.comm.dev/D4677
129,203
02.08.2022 17:27:39
14,400
ec1b0cdf22a0af02ff48ca2a674e601cac328318
[keyserver] Delete `setup.sh` Summary: Per [[ | comment ]] on D4714. Relevant Linear issue [[ | here ]]. Test Plan: Ran `git grep setup.sh` and found no occurrences of `setup.sh` in the codebase. Reviewers: ashoat, atul Subscribers: tomek, adrian, ashoat
[ { "change_type": "DELETE", "old_path": "keyserver/bash/setup.sh", "new_path": null, "diff": "-#!/usr/bin/env bash\n-\n-# run as: node user\n-# run from: root of repo\n-\n-set -e\n-\n-. ~/.nvm/nvm.sh\n-\n-chmod -R u=rwX,g=rX,o=rX .\n-chmod -R u=rwX,g=,o= keyserver/secrets\n-\n-pushd server && nvm install && popd\n-yarn cleaninstall\n-yarn workspace web prod\n-yarn workspace landing prod\n-yarn workspace keyserver prod-build\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[keyserver] Delete `setup.sh` Summary: Per @ashoat's [[ https://phab.comm.dev/D4714#135639 | comment ]] on D4714. Relevant Linear issue [[ https://linear.app/comm/issue/ENG-1536/delete-setupsh | here ]]. Test Plan: Ran `git grep setup.sh` and found no occurrences of `setup.sh` in the codebase. Reviewers: ashoat, atul Reviewed By: ashoat Subscribers: tomek, adrian, ashoat Differential Revision: https://phab.comm.dev/D4726
129,182
05.08.2022 09:19:53
-7,200
b868710dbe7313e615128c652a5041c997030e76
[web] Add jest library to web Summary: Add jest library to web to allow testing on web. Test Plan: See that everyting still compiles. Reviewers: tomek, abosh, ashoat, atul Subscribers: ashoat, adrian, atul
[ { "change_type": "MODIFY", "old_path": "web/.eslintrc.json", "new_path": "web/.eslintrc.json", "diff": "{\n\"env\": {\n- \"browser\": true\n+ \"browser\": true,\n+ \"jest\": true\n},\n\"globals\": {\n\"process\": true\n" }, { "change_type": "MODIFY", "old_path": "web/babel.config.cjs", "new_path": "web/babel.config.cjs", "diff": "@@ -7,4 +7,18 @@ module.exports = {\n'@babel/plugin-proposal-nullish-coalescing-operator',\n['@babel/plugin-transform-runtime', { useESModules: true }],\n],\n+ env: {\n+ test: {\n+ presets: [\n+ [\n+ '@babel/preset-env',\n+ {\n+ targets: {\n+ node: 'current',\n+ },\n+ },\n+ ],\n+ ],\n+ },\n+ },\n};\n" }, { "change_type": "MODIFY", "old_path": "web/package.json", "new_path": "web/package.json", "diff": "\"scripts\": {\n\"clean\": \"rm -rf dist/ && rm -rf node_modules/\",\n\"dev\": \"yarn concurrently --names=\\\"NODESSR,BROWSER\\\" -c \\\"bgBlue.bold,bgMagenta.bold\\\" \\\"yarn webpack --config webpack.config.cjs --config-name=server --watch\\\" \\\"yarn webpack-dev-server --hot --config webpack.config.cjs --config-name=browser\\\"\",\n- \"prod\": \"yarn webpack --config webpack.config.cjs --env prod --progress\"\n+ \"prod\": \"yarn webpack --config webpack.config.cjs --env prod --progress\",\n+ \"test\": \"jest\"\n},\n\"devDependencies\": {\n\"@babel/core\": \"^7.13.14\",\n\"@babel/preset-react\": \"^7.13.13\",\n\"@hot-loader/react-dom\": \"16.13.0\",\n\"assets-webpack-plugin\": \"^3.9.7\",\n+ \"babel-jest\": \"^26.6.3\",\n\"babel-loader\": \"^8.1.0\",\n\"babel-plugin-transform-remove-console\": \"^6.9.4\",\n\"clean-webpack-plugin\": \"^3.0.0\",\n\"css-loader\": \"^4.3.0\",\n\"flow-bin\": \"^0.158.0\",\n\"flow-typed\": \"^3.2.1\",\n+ \"jest\": \"^26.6.3\",\n\"mini-css-extract-plugin\": \"^0.11.2\",\n\"optimize-css-assets-webpack-plugin\": \"^5.0.3\",\n\"style-loader\": \"^1.2.1\",\n\"simple-markdown\": \"^0.7.2\",\n\"tinycolor2\": \"^1.4.1\",\n\"visibilityjs\": \"^2.0.2\"\n+ },\n+ \"jest\": {\n+ \"roots\": [\n+ \"<rootDir>/utils\"\n+ ],\n+ \"transform\": {\n+ \"\\\\.js$\": \"babel-jest\"\n+ },\n+ \"transformIgnorePatterns\": [\n+ \"/node_modules/(?!@babel/runtime)\"\n+ ]\n}\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] Add jest library to web Summary: Add jest library to web to allow testing on web. Test Plan: See that everyting still compiles. Reviewers: tomek, abosh, ashoat, atul Reviewed By: tomek, abosh, ashoat Subscribers: ashoat, adrian, atul Differential Revision: https://phab.comm.dev/D4709
129,200
04.08.2022 15:38:55
14,400
026b4b057291c1cd4760ed50a613a1eb9308374e
[native] add verify_user_token client method Summary: use the identity service client to call the VerifyUserToken RPC Test Plan: cargo build, successfully called RPC Reviewers: tomek, karol, max Subscribers: ashoat, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs", "new_path": "native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs", "diff": "@@ -6,7 +6,7 @@ use tonic::{transport::Channel, Response, Status};\nuse identity::{\nget_user_id_request::AuthType,\nidentity_service_client::IdentityServiceClient, GetUserIdRequest,\n- GetUserIdResponse,\n+ GetUserIdResponse, VerifyUserTokenRequest, VerifyUserTokenResponse,\n};\npub mod identity {\ntonic::include_proto!(\"identity\");\n@@ -53,4 +53,20 @@ impl Client {\n})\n.await\n}\n+\n+ async fn verify_user_token(\n+ &mut self,\n+ user_id: String,\n+ device_id: String,\n+ access_token: String,\n+ ) -> Result<Response<VerifyUserTokenResponse>, Status> {\n+ self\n+ .identity_client\n+ .verify_user_token(VerifyUserTokenRequest {\n+ user_id,\n+ device_id,\n+ access_token,\n+ })\n+ .await\n+ }\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] add verify_user_token client method Summary: use the identity service client to call the VerifyUserToken RPC Test Plan: cargo build, successfully called RPC Reviewers: tomek, karol, max Reviewed By: tomek Subscribers: ashoat, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4747
129,184
08.08.2022 16:18:37
14,400
8d121152a74e0f8096e487d41328a456ba7da994
[tunnelbroker] Removed unused include directives Summary: Just a minor thing I noticed while testing some of the nix tunnelbroker diffs. Test Plan: NA, CI? Reviewers: jon, abosh, varun, tomek, max, karol Subscribers: ashoat, adrian
[ { "change_type": "MODIFY", "old_path": "services/tunnelbroker/src/Amqp/AmqpManager.cpp", "new_path": "services/tunnelbroker/src/Amqp/AmqpManager.cpp", "diff": "#include \"Constants.h\"\n#include \"DeliveryBroker.h\"\n#include \"GlobalTools.h\"\n-#include \"Tools.h\"\n#include <glog/logging.h>\n" }, { "change_type": "MODIFY", "old_path": "services/tunnelbroker/src/Tools/CryptoTools.cpp", "new_path": "services/tunnelbroker/src/Tools/CryptoTools.cpp", "diff": "#include \"CryptoTools.h\"\n#include <cryptopp/base64.h>\n-#include <cryptopp/cryptlib.h>\n#include <cryptopp/filters.h>\n-#include <cryptopp/modes.h>\n-#include <cryptopp/pssr.h>\n#include <cryptopp/rsa.h>\n#include <glog/logging.h>\n" }, { "change_type": "MODIFY", "old_path": "services/tunnelbroker/src/Tools/Tools.cpp", "new_path": "services/tunnelbroker/src/Tools/Tools.cpp", "diff": "#include \"Constants.h\"\n#include <glog/logging.h>\n-#include <boost/lexical_cast.hpp>\n#include <chrono>\n#include <random>\n" }, { "change_type": "MODIFY", "old_path": "services/tunnelbroker/src/server.cpp", "new_path": "services/tunnelbroker/src/server.cpp", "diff": "#include \"AmqpManager.h\"\n#include \"ConfigManager.h\"\n-#include \"Constants.h\"\n#include \"GlobalTools.h\"\n#include \"TunnelbrokerServiceImpl.h\"\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[tunnelbroker] Removed unused include directives Summary: Just a minor thing I noticed while testing some of the nix tunnelbroker diffs. Test Plan: NA, CI? Reviewers: jon, abosh, varun, tomek, max, karol Reviewed By: jon, abosh, varun Subscribers: ashoat, adrian Differential Revision: https://phab.comm.dev/D4773
129,190
09.08.2022 14:57:47
-7,200
d79c9338ccc1ab2fe5bd92d29abb2848f23924e6
[services] Tunnelbroker - Fix scripts in Dockerfiles Summary: Raised in I mistakenly put `run_service.sh` instead of `run_tests.sh` Test Plan: ``` cd services yarn test-tunnelbroker-service ``` This should run tunnelbroker tests Reviewers: max, ashoat, tomek Subscribers: jon, ashoat, tomek, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "services/tunnelbroker/Dockerfile", "new_path": "services/tunnelbroker/Dockerfile", "diff": "@@ -43,4 +43,4 @@ COPY services/tunnelbroker/ .\nRUN scripts/build_service.sh\n-CMD if [ \"$COMM_TEST_SERVICES\" -eq 1 ]; then scripts/run_service.sh; else scripts/run_service.sh; fi\n+CMD if [ \"$COMM_TEST_SERVICES\" -eq 1 ]; then scripts/run_tests.sh; else scripts/run_service.sh; fi\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Tunnelbroker - Fix scripts in Dockerfiles Summary: Raised in https://phabricator.ashoat.com/D3988#112748 I mistakenly put `run_service.sh` instead of `run_tests.sh` Test Plan: ``` cd services yarn test-tunnelbroker-service ``` This should run tunnelbroker tests Reviewers: max, ashoat, tomek Reviewed By: max, ashoat Subscribers: jon, ashoat, tomek, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4052
129,193
04.08.2022 15:27:19
25,200
7d9a7f524d642bfbb41285e496ac31f8f3cf4b2b
[Nix] Provide nix way of starting MariaDB Summary: Provide nix native way of creating a MariaDB database Test Plan: From any branch, on a darwin (MacOS) machine: ``` nix run 'github:commE2E/comm?ref=jonringer/mariadb#mariadb-up' ``` Reviewers: ashoat, varun, abosh, atul Subscribers: ashoat, tomek, adrian
[ { "change_type": "MODIFY", "old_path": "nix/dev-shell.nix", "new_path": "nix/dev-shell.nix", "diff": ", grpc\n, libiconv\n, libuv\n+, mariadb\n, nodejs-16_x\n, olm\n, openjdk8\n@@ -42,6 +43,7 @@ mkShell {\nshellcheck\n# node development\n+ mariadb\nnodejs-16_x\nyarn\nwatchman # react native\n@@ -92,7 +94,7 @@ mkShell {\n# shell commands to be ran upon entering shell\nshellHook = let\n- socket = \"mysql-socket/mysql.sock\";\n+ socket = \"mysql.sock\";\nin ''\nif [[ \"$OSTYPE\" == 'linux'* ]]; then\nexport MYSQL_UNIX_PORT=''${XDG_RUNTIME_DIR:-/run/user/$UID}/${socket}\n@@ -102,6 +104,8 @@ mkShell {\nif [[ \"$OSTYPE\" == 'darwin'* ]]; then\n# Many commands for cocoapods expect the native BSD versions of commands\nexport PATH=/usr/bin:$PATH\n+ MARIADB_DIR=''${XDG_DATA_HOME:-$HOME/.local/share}/MariaDB\n+ export MYSQL_UNIX_PORT=\"$MARIADB_DIR\"/${socket}\nexport ANDROID_SDK_ROOT=''${ANDROID_SDK_ROOT:-$HOME/Library/Android/sdk}\nfi\n" }, { "change_type": "ADD", "old_path": null, "new_path": "nix/mariadb-up-mac.nix", "diff": "+{ lib\n+, gnused\n+, openssl\n+, mariadb\n+, writeShellApplication\n+, writeTextFile\n+}:\n+\n+let\n+ # Use small script executed by bash to have a normal shell environment.\n+ mariadb-entrypoint = writeShellApplication {\n+ name = \"mariadb-init\";\n+ text = ''\n+ MARIADB_DIR=''${XDG_DATA_HOME:-$HOME/.local/share}/MariaDB\n+ # 'exec' allows for us to replace bash process with MariaDB\n+ exec ${mariadb}/bin/mariadbd \\\n+ --socket \"$MARIADB_DIR\"/mysql.sock \\\n+ --datadir \"$MARIADB_DIR\" \\\n+ &> \"$MARIADB_DIR\"/logs\n+ '';\n+ };\n+\n+ mariadb-version = let\n+ versions = lib.versions;\n+ in \"${versions.major mariadb.version}.${versions.minor mariadb.version}\";\n+\n+ # Small boiler-plate text file for us to write for keyserver\n+ db_config_template = writeTextFile {\n+ name = \"db-config\";\n+ text = ''\n+ {\n+ \"host\": \"localhost\",\n+ \"user\": \"comm\",\n+ \"password\": \"PASS\",\n+ \"database\": \"comm\",\n+ \"dbType\": \"mariadb${mariadb-version}\"\n+ }\n+ '';\n+ };\n+\n+# writeShellApplication is a \"writer helper\" which\n+# will create a shellchecked executable shell script located in $out/bin/<name>\n+# This shell script will be used to allow for impure+stateful actions\n+in writeShellApplication {\n+ name = \"mariadb-up\";\n+ text = ''\n+ # \"$HOME/Library/Application Support/<app>\" is the canonical path to use\n+ # on darwin for storing user data for installed applications.\n+ # However, mysql and mariadb don't quote paths in the mariadbd script,\n+ # so use XDG conventions and hope $HOME doesn't have a space.\n+ MARIADB_DATA_HOME=\"''${XDG_DATA_HOME:-$HOME/.local/share}/MariaDB\"\n+ MARIADB_PIDFILE=\"$MARIADB_DATA_HOME\"/mariadb.pid\n+ export MYSQL_UNIX_PORT=\"$MARIADB_DATA_HOME\"/mysql.sock\n+\n+ if [[ ! -d \"$MARIADB_DATA_HOME\"/mysql ]]; then\n+ # mysql directory should exist if MariaDB has been initialized\n+ echo \"Initializing MariaDB database at $MARIADB_DATA_HOME\" >&2\n+ \"${lib.getBin mariadb}/bin/mariadb-install-db\" \\\n+ --datadir=\"$MARIADB_DATA_HOME\" \\\n+ --auth-root-authentication-method=socket\n+ fi\n+\n+ # Check if MariaDB server was already started\n+ set +e # allow for pgrep to not find matches\n+ # BSD pgrep doesn't have a \"count\" feature, use wc then trim whitespace\n+ mariadb_count=$(pgrep mariadbd | wc -l | xargs echo)\n+ set -e\n+\n+ if [[ \"$mariadb_count\" -eq \"0\" ]]; then\n+ echo \"Starting MariaDB server\"\n+ # No MariaDB present, start our own\n+ # Launch in subshell so if the original terminal is closed, the process\n+ # will be inherited instead of also being forced closed\n+ (\"${mariadb-entrypoint}/bin/mariadb-init\" &\n+ echo \"$!\" > \"$MARIADB_PIDFILE\")\n+\n+ echo \"Waiting for MariaDB to come up\"\n+ while [[ ! -S \"$MYSQL_UNIX_PORT\" ]]; do sleep 1; done\n+\n+ elif [[ \"$mariadb_count\" -eq \"1\" ]]; then\n+\n+ # Check if it was started by this script\n+ running_pid=\"$(pgrep mariadbd)\"\n+ if [[ ! -f \"$MARIADB_PIDFILE\" ]] || \\\n+ [[ \"$(cat \"$MARIADB_PIDFILE\")\" != \"$running_pid\" ]]; then\n+ echo \"Existing MariaDB instance found outside of nix environment\" >&2\n+ echo \"Please stop existing services and attempt 'mariadb-up' again\" >&2\n+ exit 1\n+ fi\n+\n+ else\n+ echo \"Many MariaDB instances found outside of nix environment\" >&2\n+ echo \"Please stop existing services and attempt 'mariadb-up' again\" >&2\n+ exit 1\n+\n+ fi\n+\n+ # Initialize comm user, database, and secrets file for MariaDB\n+ # Connecting through socket doesn't require a password\n+ userCount=$(\"${lib.getBin mariadb}/bin/mariadb\" -u \"$USER\" \\\n+ -Bse \"SELECT COUNT(1) FROM mysql.user WHERE user = 'comm';\"\n+ )\n+ if [[ \"$userCount\" -eq 0 ]]; then\n+ PASS=$(\"${lib.getBin openssl}/bin/openssl\" rand -hex 6)\n+\n+ echo \"Creating comm user and comm database\" >&2\n+ \"${lib.getBin mariadb}/bin/mariadb\" -u \"$USER\" \\\n+ -Bse \"CREATE DATABASE comm;\n+ CREATE USER comm@localhost IDENTIFIED BY '$PASS';\n+ GRANT ALL ON \"'comm.*'\" TO comm@localhost;\"\n+ echo \"Comm user and database has been created!\" >&2\n+\n+ # Assume this was ran from git repository\n+ PRJ_ROOT=$(git rev-parse --show-toplevel)\n+ KEYSERVER_DB_CONFIG=\"$PRJ_ROOT\"/keyserver/secrets/db_config.json\n+\n+ echo \"Writing connection information to $KEYSERVER_DB_CONFIG\" >&2\n+ mkdir -p \"$(dirname \"$KEYSERVER_DB_CONFIG\")\"\n+\n+ # It's very difficult to write json from bash, just copy a nix\n+ # file then use sed to subsitute\n+ cp \"${db_config_template}\" \"$KEYSERVER_DB_CONFIG\"\n+ chmod +w \"$KEYSERVER_DB_CONFIG\" # Nix files are read-only\n+ \"${gnused}/bin/sed\" -i -e \"s|PASS|$PASS|g\" \"$KEYSERVER_DB_CONFIG\"\n+ fi\n+\n+ echo \"View MariaDB Logs: tail -f $MARIADB_DATA_HOME/logs\" >&2\n+ echo \"Kill MariaDB server: pkill mariadbd\" >&2\n+ '';\n+}\n" }, { "change_type": "MODIFY", "old_path": "nix/overlay.nix", "new_path": "nix/overlay.nix", "diff": "@@ -45,6 +45,11 @@ prev:\ndevShell = final.callPackage ./dev-shell.nix { };\n+ # Make our version of mariadb the default everywhere\n+ mariadb = prev.mariadb_108;\n+\n+ mariadb-up = prev.callPackage ./mariadb-up-mac.nix { };\n+\nmysql-down = prev.callPackage ./mysql-down-linux.nix { };\nmysql-up = prev.callPackage ./mysql-up-linux.nix { };\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[Nix] Provide nix way of starting MariaDB Summary: Provide nix native way of creating a MariaDB database Test Plan: From any branch, on a darwin (MacOS) machine: ``` nix run 'github:commE2E/comm?ref=jonringer/mariadb#mariadb-up' ``` Reviewers: ashoat, varun, abosh, atul Reviewed By: varun, abosh Subscribers: ashoat, tomek, adrian Differential Revision: https://phab.comm.dev/D4750
129,184
10.08.2022 14:44:14
14,400
1b9ebceef002ff21ba3a8622064b0ef403237a8c
[native] `codeVersion` -> 141
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -434,8 +434,8 @@ android {\napplicationId 'app.comm.android'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 140\n- versionName '1.0.140'\n+ versionCode 141\n+ versionName '1.0.141'\nmissingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "new_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "diff": "@@ -13,7 +13,7 @@ namespace comm {\nnamespace jsi = facebook::jsi;\nclass CommCoreModule : public facebook::react::CommCoreModuleSchemaCxxSpecJSI {\n- const int codeVersion{140};\n+ const int codeVersion{141};\nstd::unique_ptr<WorkerThread> databaseThread;\nstd::unique_ptr<WorkerThread> cryptoThread;\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.debug.plist", "new_path": "native/ios/Comm/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.140</string>\n+ <string>1.0.141</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>140</string>\n+ <string>141</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.release.plist", "new_path": "native/ios/Comm/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.140</string>\n+ <string>1.0.141</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>140</string>\n+ <string>141</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] `codeVersion` -> 141
129,203
11.08.2022 12:20:11
14,400
e4700dca8ef9594f3521201f9af0c72a9b9db65b
[web] Remove extraneous `console.log(...)` statement from `MessageTimestampTooltip`
[ { "change_type": "MODIFY", "old_path": "web/chat/message-timestamp-tooltip.react.js", "new_path": "web/chat/message-timestamp-tooltip.react.js", "diff": "@@ -31,7 +31,6 @@ type Props = {\nfunction MessageTimestampTooltip(props: Props): React.Node {\nconst { messagePositionInfo, timeZone } = props;\nconst { time, creator, type } = messagePositionInfo.item.messageInfo;\n- console.log(messagePositionInfo);\nconst text = React.useMemo(() => longAbsoluteDate(time, timeZone), [\ntime,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] Remove extraneous `console.log(...)` statement from `MessageTimestampTooltip`
129,200
10.08.2022 15:32:08
14,400
d12c7f9e54c0820b58ecba6ff16455aa8b32b62e
[services] fix update expression for DDB Summary: Apparently the SET keyword should only be used once in update expressions. Test Plan: Used the DDB client and successfully updated an item in the users table Reviewers: tomek, karol Subscribers: ashoat, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "services/identity/src/database.rs", "new_path": "services/identity/src/database.rs", "diff": "@@ -86,25 +86,23 @@ impl DatabaseClient {\nusername: Option<String>,\nuser_public_key: Option<String>,\n) -> Result<UpdateItemOutput, Error> {\n- let mut update_expression = String::new();\n+ let mut update_expression_parts = Vec::new();\nlet mut expression_attribute_values = HashMap::new();\nif let Some(reg) = registration {\n- update_expression\n- .push_str(&format!(\"SET {} :r \", USERS_TABLE_REGISTRATION_ATTRIBUTE));\n+ update_expression_parts\n+ .push(format!(\"{} = :r\", USERS_TABLE_REGISTRATION_ATTRIBUTE));\nexpression_attribute_values\n.insert(\":r\".into(), AttributeValue::B(Blob::new(reg.serialize())));\n};\nif let Some(username) = username {\n- update_expression\n- .push_str(&format!(\"SET {} = :u \", USERS_TABLE_USERNAME_ATTRIBUTE));\n+ update_expression_parts\n+ .push(format!(\"{} = :u\", USERS_TABLE_USERNAME_ATTRIBUTE));\nexpression_attribute_values\n.insert(\":u\".into(), AttributeValue::S(username));\n};\nif let Some(public_key) = user_public_key {\n- update_expression.push_str(&format!(\n- \"SET {} = :k \",\n- USERS_TABLE_USER_PUBLIC_KEY_ATTRIBUTE\n- ));\n+ update_expression_parts\n+ .push(format!(\"{} = :k\", USERS_TABLE_USER_PUBLIC_KEY_ATTRIBUTE));\nexpression_attribute_values\n.insert(\":k\".into(), AttributeValue::S(public_key));\n};\n@@ -114,7 +112,7 @@ impl DatabaseClient {\n.update_item()\n.table_name(USERS_TABLE)\n.key(USERS_TABLE_PARTITION_KEY, AttributeValue::S(user_id))\n- .update_expression(update_expression)\n+ .update_expression(format!(\"SET {}\", update_expression_parts.join(\",\")))\n.set_expression_attribute_values(Some(expression_attribute_values))\n.send()\n.await\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] fix update expression for DDB Summary: Apparently the SET keyword should only be used once in update expressions. Test Plan: Used the DDB client and successfully updated an item in the users table Reviewers: tomek, karol Reviewed By: tomek Subscribers: ashoat, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4797
129,200
10.08.2022 19:16:05
14,400
238538eda84c54bb02cdd7e7a0c95ff2729e105f
[native] new dependencies for gRPC client Summary: We use all of these dependencies in the Identity service. Depends on D4797 Test Plan: `cargo build` Reviewers: ashoat, tomek Subscribers: tomek, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/grpc/grpc_client/Cargo.lock", "new_path": "native/cpp/CommonCpp/grpc/grpc_client/Cargo.lock", "diff": "@@ -944,11 +944,14 @@ dependencies = [\n\"cxx-build\",\n\"identity\",\n\"lazy_static\",\n+ \"opaque-ke\",\n\"prost 0.11.0\",\n+ \"rand\",\n\"tokio\",\n\"tokio-stream\",\n\"tonic 0.8.0\",\n\"tonic-build 0.8.0\",\n+ \"tracing\",\n]\n[[package]]\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/grpc/grpc_client/Cargo.toml", "new_path": "native/cpp/CommonCpp/grpc/grpc_client/Cargo.toml", "diff": "@@ -13,6 +13,9 @@ tokio-stream = \"0.1\"\ntonic = \"0.8\"\nprost = \"0.11\"\nlazy_static = \"1.4\"\n+rand = \"0.8\"\n+opaque-ke = \"1.2\"\n+tracing = \"0.1\"\nidentity = {path = \"../../../../../services/identity\" }\n[build-dependencies]\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] new dependencies for gRPC client Summary: We use all of these dependencies in the Identity service. Depends on D4797 Test Plan: `cargo build` Reviewers: ashoat, tomek Reviewed By: ashoat, tomek Subscribers: tomek, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4798
129,200
10.08.2022 19:19:37
14,400
5a8492a7faebf942dd411365c9a3a08e56e3f935
[native] small changes to the client methods Summary: add tracing and fix the endpoint for the Identity service Depends on D4798 Test Plan: `cargo build` Reviewers: tomek, karol Subscribers: ashoat, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs", "new_path": "native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs", "diff": "@@ -2,6 +2,7 @@ use lazy_static::lazy_static;\nuse std::sync::Arc;\nuse tokio::runtime::{Builder, Runtime};\nuse tonic::{transport::Channel, Response, Status};\n+use tracing::instrument;\nuse crate::identity::{\nget_user_id_request::AuthType,\n@@ -12,7 +13,7 @@ pub mod identity {\ntonic::include_proto!(\"identity\");\n}\n-const IDENTITY_SERVICE_SOCKET_ADDR: &str = \"[::1]:50051\";\n+const IDENTITY_SERVICE_SOCKET_ADDR: &str = \"https://[::1]:50051\";\nlazy_static! {\npub static ref RUNTIME: Arc<Runtime> = Arc::new(\n@@ -40,6 +41,7 @@ impl Client {\n}\n}\n+ #[instrument(skip(self))]\nasync fn get_user_id(\n&mut self,\nauth_type: AuthType,\n@@ -54,6 +56,7 @@ impl Client {\n.await\n}\n+ #[instrument(skip(self))]\nasync fn verify_user_token(\n&mut self,\nuser_id: String,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] small changes to the client methods Summary: add tracing and fix the endpoint for the Identity service Depends on D4798 Test Plan: `cargo build` Reviewers: tomek, karol Reviewed By: tomek Subscribers: ashoat, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4799
129,187
15.08.2022 16:04:06
14,400
722474a2e0fe30b26990543f2d5490f47883182d
[native] Fix up redux-persist types Summary: This resolves [ENG-1593](https://linear.app/comm/issue/ENG-1593/make-sure-flow-on-native-checks-how-redux-persist-is-used). See [this comment](https://linear.app/comm/issue/ENG-1593#comment-77afa017). Test Plan: Flow Reviewers: tomek Subscribers: adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "native/.flowconfig", "new_path": "native/.flowconfig", "diff": "; We fork some components by platform\n.*/*[.]android.js\n-.*/node_modules/redux-persist/lib/index.js\n.*/node_modules/react-native-fast-image/src/index.js.flow\n.*/node_modules/react-native-fs/FS.common.js\n.*/node_modules/react-native-gesture-handler/Swipeable.js\n" }, { "change_type": "DELETE", "old_path": "native/flow-typed/npm/redux-persist_vx.x.x.js", "new_path": null, "diff": "-// flow-typed signature: 137cf1283d00613a920849b28dffac06\n-// flow-typed version: <<STUB>>/redux-persist_v5.4.0/flow_v0.57.3\n-\n-/**\n- * This is an autogenerated libdef stub for:\n- *\n- * 'redux-persist'\n- *\n- * Fill this stub out by replacing all the `any` types.\n- *\n- * Once filled out, we encourage you to share your work with the\n- * community by sending a pull request to:\n- * https://github.com/flowtype/flow-typed\n- */\n-\n-declare module 'redux-persist' {\n- declare module.exports: any;\n-}\n-\n-/**\n- * We include stubs for each file inside this npm package in case you need to\n- * require those files directly. Feel free to delete any files that aren't\n- * needed.\n- */\n-declare module 'redux-persist/es/constants' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/createMigrate' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/createPersistoid' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/createTransform' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/getStoredState' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/index' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/integration/getStoredStateMigrateV4' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/integration/react' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/persistCombineReducers' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/persistReducer' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/persistStore' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/purgeStoredState' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/stateReconciler/autoMergeLevel1' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/stateReconciler/autoMergeLevel2' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/stateReconciler/hardSet' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/storage/createWebStorage' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/storage/getStorage' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/storage/index' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/storage/index.native' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/storage/session' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/types' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/es/utils/curry' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/constants' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/createMigrate' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/createPersistoid' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/createTransform' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/getStoredState' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/index' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/integration/getStoredStateMigrateV4' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/integration/react' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/persistCombineReducers' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/persistReducer' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/persistStore' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/purgeStoredState' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/stateReconciler/autoMergeLevel1' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/stateReconciler/autoMergeLevel2' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/stateReconciler/hardSet' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/storage/createWebStorage' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/storage/getStorage' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/storage/index' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/storage/index.native' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/storage/session' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/types' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/lib/utils/curry' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/constants' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/createMigrate' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/createPersistoid' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/createTransform' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/getStoredState' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/index' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/integration/getStoredStateMigrateV4' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/integration/react' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/persistCombineReducers' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/persistReducer' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/persistStore' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/purgeStoredState' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/stateReconciler/autoMergeLevel1' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/stateReconciler/autoMergeLevel2' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/stateReconciler/hardSet' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/storage/createWebStorage' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/storage/getStorage' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/storage/index' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/storage/index.native' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/storage/session' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/types' {\n- declare module.exports: any;\n-}\n-\n-declare module 'redux-persist/src/utils/curry' {\n- declare module.exports: any;\n-}\n-\n-// Filename aliases\n-declare module 'redux-persist/es/constants.js' {\n- declare module.exports: $Exports<'redux-persist/es/constants'>;\n-}\n-declare module 'redux-persist/es/createMigrate.js' {\n- declare module.exports: $Exports<'redux-persist/es/createMigrate'>;\n-}\n-declare module 'redux-persist/es/createPersistoid.js' {\n- declare module.exports: $Exports<'redux-persist/es/createPersistoid'>;\n-}\n-declare module 'redux-persist/es/createTransform.js' {\n- declare module.exports: $Exports<'redux-persist/es/createTransform'>;\n-}\n-declare module 'redux-persist/es/getStoredState.js' {\n- declare module.exports: $Exports<'redux-persist/es/getStoredState'>;\n-}\n-declare module 'redux-persist/es/index.js' {\n- declare module.exports: $Exports<'redux-persist/es/index'>;\n-}\n-declare module 'redux-persist/es/integration/getStoredStateMigrateV4.js' {\n- declare module.exports: $Exports<'redux-persist/es/integration/getStoredStateMigrateV4'>;\n-}\n-declare module 'redux-persist/es/integration/react.js' {\n- declare module.exports: $Exports<'redux-persist/es/integration/react'>;\n-}\n-declare module 'redux-persist/es/persistCombineReducers.js' {\n- declare module.exports: $Exports<'redux-persist/es/persistCombineReducers'>;\n-}\n-declare module 'redux-persist/es/persistReducer.js' {\n- declare module.exports: $Exports<'redux-persist/es/persistReducer'>;\n-}\n-declare module 'redux-persist/es/persistStore.js' {\n- declare module.exports: $Exports<'redux-persist/es/persistStore'>;\n-}\n-declare module 'redux-persist/es/purgeStoredState.js' {\n- declare module.exports: $Exports<'redux-persist/es/purgeStoredState'>;\n-}\n-declare module 'redux-persist/es/stateReconciler/autoMergeLevel1.js' {\n- declare module.exports: $Exports<'redux-persist/es/stateReconciler/autoMergeLevel1'>;\n-}\n-declare module 'redux-persist/es/stateReconciler/autoMergeLevel2.js' {\n- declare module.exports: $Exports<'redux-persist/es/stateReconciler/autoMergeLevel2'>;\n-}\n-declare module 'redux-persist/es/stateReconciler/hardSet.js' {\n- declare module.exports: $Exports<'redux-persist/es/stateReconciler/hardSet'>;\n-}\n-declare module 'redux-persist/es/storage/createWebStorage.js' {\n- declare module.exports: $Exports<'redux-persist/es/storage/createWebStorage'>;\n-}\n-declare module 'redux-persist/es/storage/getStorage.js' {\n- declare module.exports: $Exports<'redux-persist/es/storage/getStorage'>;\n-}\n-declare module 'redux-persist/es/storage/index.js' {\n- declare module.exports: $Exports<'redux-persist/es/storage/index'>;\n-}\n-declare module 'redux-persist/es/storage/index.native.js' {\n- declare module.exports: $Exports<'redux-persist/es/storage/index.native'>;\n-}\n-declare module 'redux-persist/es/storage/session.js' {\n- declare module.exports: $Exports<'redux-persist/es/storage/session'>;\n-}\n-declare module 'redux-persist/es/types.js' {\n- declare module.exports: $Exports<'redux-persist/es/types'>;\n-}\n-declare module 'redux-persist/es/utils/curry.js' {\n- declare module.exports: $Exports<'redux-persist/es/utils/curry'>;\n-}\n-declare module 'redux-persist/lib/constants.js' {\n- declare module.exports: $Exports<'redux-persist/lib/constants'>;\n-}\n-declare module 'redux-persist/lib/createMigrate.js' {\n- declare module.exports: $Exports<'redux-persist/lib/createMigrate'>;\n-}\n-declare module 'redux-persist/lib/createPersistoid.js' {\n- declare module.exports: $Exports<'redux-persist/lib/createPersistoid'>;\n-}\n-declare module 'redux-persist/lib/createTransform.js' {\n- declare module.exports: $Exports<'redux-persist/lib/createTransform'>;\n-}\n-declare module 'redux-persist/lib/getStoredState.js' {\n- declare module.exports: $Exports<'redux-persist/lib/getStoredState'>;\n-}\n-declare module 'redux-persist/lib/index.js' {\n- declare module.exports: $Exports<'redux-persist/lib/index'>;\n-}\n-declare module 'redux-persist/lib/integration/getStoredStateMigrateV4.js' {\n- declare module.exports: $Exports<'redux-persist/lib/integration/getStoredStateMigrateV4'>;\n-}\n-declare module 'redux-persist/lib/integration/react.js' {\n- declare module.exports: $Exports<'redux-persist/lib/integration/react'>;\n-}\n-declare module 'redux-persist/lib/persistCombineReducers.js' {\n- declare module.exports: $Exports<'redux-persist/lib/persistCombineReducers'>;\n-}\n-declare module 'redux-persist/lib/persistReducer.js' {\n- declare module.exports: $Exports<'redux-persist/lib/persistReducer'>;\n-}\n-declare module 'redux-persist/lib/persistStore.js' {\n- declare module.exports: $Exports<'redux-persist/lib/persistStore'>;\n-}\n-declare module 'redux-persist/lib/purgeStoredState.js' {\n- declare module.exports: $Exports<'redux-persist/lib/purgeStoredState'>;\n-}\n-declare module 'redux-persist/lib/stateReconciler/autoMergeLevel1.js' {\n- declare module.exports: $Exports<'redux-persist/lib/stateReconciler/autoMergeLevel1'>;\n-}\n-declare module 'redux-persist/lib/stateReconciler/autoMergeLevel2.js' {\n- declare module.exports: $Exports<'redux-persist/lib/stateReconciler/autoMergeLevel2'>;\n-}\n-declare module 'redux-persist/lib/stateReconciler/hardSet.js' {\n- declare module.exports: $Exports<'redux-persist/lib/stateReconciler/hardSet'>;\n-}\n-declare module 'redux-persist/lib/storage/createWebStorage.js' {\n- declare module.exports: $Exports<'redux-persist/lib/storage/createWebStorage'>;\n-}\n-declare module 'redux-persist/lib/storage/getStorage.js' {\n- declare module.exports: $Exports<'redux-persist/lib/storage/getStorage'>;\n-}\n-declare module 'redux-persist/lib/storage/index.js' {\n- declare module.exports: $Exports<'redux-persist/lib/storage/index'>;\n-}\n-declare module 'redux-persist/lib/storage/index.native.js' {\n- declare module.exports: $Exports<'redux-persist/lib/storage/index.native'>;\n-}\n-declare module 'redux-persist/lib/storage/session.js' {\n- declare module.exports: $Exports<'redux-persist/lib/storage/session'>;\n-}\n-declare module 'redux-persist/lib/types.js' {\n- declare module.exports: $Exports<'redux-persist/lib/types'>;\n-}\n-declare module 'redux-persist/lib/utils/curry.js' {\n- declare module.exports: $Exports<'redux-persist/lib/utils/curry'>;\n-}\n-declare module 'redux-persist/src/constants.js' {\n- declare module.exports: $Exports<'redux-persist/src/constants'>;\n-}\n-declare module 'redux-persist/src/createMigrate.js' {\n- declare module.exports: $Exports<'redux-persist/src/createMigrate'>;\n-}\n-declare module 'redux-persist/src/createPersistoid.js' {\n- declare module.exports: $Exports<'redux-persist/src/createPersistoid'>;\n-}\n-declare module 'redux-persist/src/createTransform.js' {\n- declare module.exports: $Exports<'redux-persist/src/createTransform'>;\n-}\n-declare module 'redux-persist/src/getStoredState.js' {\n- declare module.exports: $Exports<'redux-persist/src/getStoredState'>;\n-}\n-declare module 'redux-persist/src/index.js' {\n- declare module.exports: $Exports<'redux-persist/src/index'>;\n-}\n-declare module 'redux-persist/src/integration/getStoredStateMigrateV4.js' {\n- declare module.exports: $Exports<'redux-persist/src/integration/getStoredStateMigrateV4'>;\n-}\n-declare module 'redux-persist/src/integration/react.js' {\n- declare module.exports: $Exports<'redux-persist/src/integration/react'>;\n-}\n-declare module 'redux-persist/src/persistCombineReducers.js' {\n- declare module.exports: $Exports<'redux-persist/src/persistCombineReducers'>;\n-}\n-declare module 'redux-persist/src/persistReducer.js' {\n- declare module.exports: $Exports<'redux-persist/src/persistReducer'>;\n-}\n-declare module 'redux-persist/src/persistStore.js' {\n- declare module.exports: $Exports<'redux-persist/src/persistStore'>;\n-}\n-declare module 'redux-persist/src/purgeStoredState.js' {\n- declare module.exports: $Exports<'redux-persist/src/purgeStoredState'>;\n-}\n-declare module 'redux-persist/src/stateReconciler/autoMergeLevel1.js' {\n- declare module.exports: $Exports<'redux-persist/src/stateReconciler/autoMergeLevel1'>;\n-}\n-declare module 'redux-persist/src/stateReconciler/autoMergeLevel2.js' {\n- declare module.exports: $Exports<'redux-persist/src/stateReconciler/autoMergeLevel2'>;\n-}\n-declare module 'redux-persist/src/stateReconciler/hardSet.js' {\n- declare module.exports: $Exports<'redux-persist/src/stateReconciler/hardSet'>;\n-}\n-declare module 'redux-persist/src/storage/createWebStorage.js' {\n- declare module.exports: $Exports<'redux-persist/src/storage/createWebStorage'>;\n-}\n-declare module 'redux-persist/src/storage/getStorage.js' {\n- declare module.exports: $Exports<'redux-persist/src/storage/getStorage'>;\n-}\n-declare module 'redux-persist/src/storage/index.js' {\n- declare module.exports: $Exports<'redux-persist/src/storage/index'>;\n-}\n-declare module 'redux-persist/src/storage/index.native.js' {\n- declare module.exports: $Exports<'redux-persist/src/storage/index.native'>;\n-}\n-declare module 'redux-persist/src/storage/session.js' {\n- declare module.exports: $Exports<'redux-persist/src/storage/session'>;\n-}\n-declare module 'redux-persist/src/types.js' {\n- declare module.exports: $Exports<'redux-persist/src/types'>;\n-}\n-declare module 'redux-persist/src/utils/curry.js' {\n- declare module.exports: $Exports<'redux-persist/src/utils/curry'>;\n-}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Fix up redux-persist types Summary: This resolves [ENG-1593](https://linear.app/comm/issue/ENG-1593/make-sure-flow-on-native-checks-how-redux-persist-is-used). See [this comment](https://linear.app/comm/issue/ENG-1593#comment-77afa017). Test Plan: Flow Reviewers: tomek Reviewed By: tomek Subscribers: adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4837
129,187
15.08.2022 14:40:43
14,400
3b928cdd35d88db1bb6daf4332f6f22235ecdb5d
[keyserver] Introduce assertValidDBType Summary: This diff is a simple refactor, and should be a no-op. In the next diff I'll modify `assertValidDBType` to deprecate MySQL. Test Plan: 1. Flow 2. I ran `keyserver` locally and made sure things generally still worked Reviewers: tomek, atul Subscribers: adrian, abosh
[ { "change_type": "MODIFY", "old_path": "keyserver/src/database/db-config.js", "new_path": "keyserver/src/database/db-config.js", "diff": "@@ -13,6 +13,17 @@ export type DBConfig = {\n+dbType: DBType,\n};\n+function assertValidDBType(dbType: ?string): DBType {\n+ if (!dbType) {\n+ return 'mysql5.7';\n+ }\n+ invariant(\n+ dbType === 'mysql5.7' || dbType === 'mariadb10.8',\n+ `${dbType} is not a valid dbType`,\n+ );\n+ return dbType;\n+}\n+\nlet dbConfig;\nasync function getDBConfig(): Promise<DBConfig> {\nif (dbConfig !== undefined) {\n@@ -28,10 +39,7 @@ async function getDBConfig(): Promise<DBConfig> {\nuser: process.env.COMM_DATABASE_USER,\npassword: process.env.COMM_DATABASE_PASSWORD,\ndatabase: process.env.COMM_DATABASE_DATABASE,\n- dbType:\n- process.env.COMM_DATABASE_TYPE === 'mariadb10.8'\n- ? 'mariadb10.8'\n- : 'mysql5.7',\n+ dbType: assertValidDBType(process.env.COMM_DATABASE_TYPE),\n};\n} else {\nconst importedDBConfig = await importJSON({\n@@ -41,8 +49,7 @@ async function getDBConfig(): Promise<DBConfig> {\ninvariant(importedDBConfig, 'DB config missing');\ndbConfig = {\n...importedDBConfig,\n- dbType:\n- importedDBConfig.dbType === 'mariadb10.8' ? 'mariadb10.8' : 'mysql5.7',\n+ dbType: assertValidDBType(importedDBConfig.dbType),\n};\n}\nreturn dbConfig;\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[keyserver] Introduce assertValidDBType Summary: This diff is a simple refactor, and should be a no-op. In the next diff I'll modify `assertValidDBType` to deprecate MySQL. Test Plan: 1. Flow 2. I ran `keyserver` locally and made sure things generally still worked Reviewers: tomek, atul Reviewed By: tomek Subscribers: adrian, abosh Differential Revision: https://phab.comm.dev/D4832
129,191
16.08.2022 13:21:57
-7,200
5b9642aee34cf4047fbee8fefeaa3aee43fc02a3
[web] Use dispatchActionPromise when logging out Summary: Instead of calling server directly, we need to use `dispatchActionPromise` function, so that relevant redux actions are dispatched. Fixes Test Plan: Log out and check if logout success action was dispatched. Reviewers: jacek, atul, ashoat Subscribers: ashoat, adrian, abosh
[ { "change_type": "MODIFY", "old_path": "web/settings/account-settings.react.js", "new_path": "web/settings/account-settings.react.js", "diff": "import * as React from 'react';\n-import { logOut } from 'lib/actions/user-actions';\n+import { logOut, logOutActionTypes } from 'lib/actions/user-actions';\nimport { preRequestUserStateSelector } from 'lib/selectors/account-selectors';\n-import { useServerCall } from 'lib/utils/action-utils';\n+import {\n+ useDispatchActionPromise,\n+ useServerCall,\n+} from 'lib/utils/action-utils';\nimport { useModalContext } from '../modals/modal-provider.react';\nimport { useSelector } from '../redux/redux-utils';\n@@ -17,9 +20,15 @@ import FriendListModal from './relationship/friend-list-modal.react';\nfunction AccountSettings(): React.Node {\nconst sendLogoutRequest = useServerCall(logOut);\nconst preRequestUserState = useSelector(preRequestUserStateSelector);\n- const logOutUser = React.useCallback(() => {\n- sendLogoutRequest(preRequestUserState);\n- }, [sendLogoutRequest, preRequestUserState]);\n+ const dispatchActionPromise = useDispatchActionPromise();\n+ const logOutUser = React.useCallback(\n+ () =>\n+ dispatchActionPromise(\n+ logOutActionTypes,\n+ sendLogoutRequest(preRequestUserState),\n+ ),\n+ [dispatchActionPromise, preRequestUserState, sendLogoutRequest],\n+ );\nconst { pushModal, popModal } = useModalContext();\nconst showPasswordChangeModal = React.useCallback(\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] Use dispatchActionPromise when logging out Summary: Instead of calling server directly, we need to use `dispatchActionPromise` function, so that relevant redux actions are dispatched. Fixes https://linear.app/comm/issue/ENG-1604/clean-enabled-apps-on-logout Test Plan: Log out and check if logout success action was dispatched. Reviewers: jacek, atul, ashoat Reviewed By: ashoat Subscribers: ashoat, adrian, abosh Differential Revision: https://phab.comm.dev/D4847
129,200
11.08.2022 23:41:15
14,400
3aecb610154dad25f18989e1906d00d47d30e315
[native] set up CXX bridge Summary: create the ffi module that will be used to generate the bridge between C++ and Rust code Depends on D4815 Test Plan: `cargo build` Reviewers: tomek, karol Subscribers: jon, ashoat, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/grpc/grpc_client/build.rs", "new_path": "native/cpp/CommonCpp/grpc/grpc_client/build.rs", "diff": "fn main() {\ntonic_build::compile_protos(\"../protos/identity.proto\")\n.unwrap_or_else(|e| panic!(\"Failed to compile protos {:?}\", e));\n+ let _cxx_build = cxx_build::bridge(\"src/lib.rs\");\n+ println!(\"cargo:rerun-if-changed=src/hello.c\");\n}\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs", "new_path": "native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs", "diff": "@@ -48,6 +48,9 @@ lazy_static! {\n);\n}\n+#[cxx::bridge(namespace = \"identity\")]\n+mod ffi {}\n+\npub struct Client {\nidentity_client: IdentityServiceClient<Channel>,\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] set up CXX bridge Summary: create the ffi module that will be used to generate the bridge between C++ and Rust code Depends on D4815 Test Plan: `cargo build` Reviewers: tomek, karol Reviewed By: tomek, karol Subscribers: jon, ashoat, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4820
129,200
12.08.2022 01:12:02
14,400
630cd9b1ac4a1505e22b20410a5b84a908166a42
[native] add corrosion to android cmake project Summary: add corrosion to the CMakeLists.txt file with `find_package` Depends on D4820 Test Plan: successfully built the android app Reviewers: tomek, karol, max, jon, inka, ashoat Subscribers: ashoat, adrian, atul, abosh
[ { "change_type": "MODIFY", "old_path": "native/android/app/CMakeLists.txt", "new_path": "native/android/app/CMakeLists.txt", "diff": "@@ -11,13 +11,12 @@ set (CMAKE_CXX_STANDARD 14)\n# cmake-lint: disable=C0301\n# Sets the minimum version of CMake required to build the native library.\n-cmake_minimum_required(VERSION 3.4.1)\n+cmake_minimum_required(VERSION 3.18)\n# Creates and names a library, sets it as either STATIC\n# or SHARED, and provides the relative paths to its source code.\n# You can define multiple libraries, and CMake builds them for you.\n# Gradle automatically packages shared libraries with your APK.\n-\nset(PACKAGE_NAME \"comm_jni_module\")\nfind_package(fbjni REQUIRED CONFIG)\n@@ -37,11 +36,24 @@ set(protobuf_BUILD_TESTS OFF)\n# gRPC building parameters\nset(gRPC_BUILD_CSHARP_EXT OFF)\nset(gRPC_SSL_PROVIDER \"package\" CACHE STRING \"SSL library provider\")\n+\n+# gRPC client\n+include(FetchContent)\n+\n+FetchContent_Declare(\n+ Corrosion\n+ GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git\n+ GIT_TAG v0.2.1\n+)\n+\n+FetchContent_MakeAvailable(Corrosion)\n+\n# Disable unused plugins\nset(gRPC_BUILD_GRPC_PHP_PLUGIN OFF)\nset(gRPC_BUILD_GRPC_RUBY_PLUGIN OFF)\nset(gRPC_BUILD_GRPC_PYTHON_PLUGIN OFF)\nset(gRPC_BUILD_GRPC_CSHARP_PLUGIN OFF)\n+\n# We're updating parameters below for Cmake's find_OpenSSL() function\nset(OPENSSL_ROOT_DIR\n\"${_third_party_dir}/openssl/openssl-${OPENSSL_VERSION}/${_android_build_dir}\"\n@@ -162,14 +174,14 @@ add_library(\n)\nadd_definitions(\n- ## Folly\n+ # Folly\n-DFOLLY_NO_CONFIG=1\n-DFOLLY_HAVE_CLOCK_GETTIME=1\n-DFOLLY_HAVE_MEMRCHR=1\n-DFOLLY_USE_LIBCPP=1\n-DFOLLY_MOBILE=1\n- ## SQLCipher\n+ # SQLCipher\n-DSQLITE_THREADSAFE=0\n-DSQLITE_HAS_CODEC\n-DSQLITE_TEMP_STORE=2\n" }, { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -508,6 +508,7 @@ android {\nexternalNativeBuild {\ncmake {\npath \"CMakeLists.txt\"\n+ version \"3.18.1\"\n}\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] add corrosion to android cmake project Summary: add corrosion to the CMakeLists.txt file with `find_package` Depends on D4820 Test Plan: successfully built the android app Reviewers: tomek, karol, max, jon, inka, ashoat Reviewed By: jon, ashoat Subscribers: ashoat, adrian, atul, abosh Differential Revision: https://phab.comm.dev/D4821
129,196
19.08.2022 15:25:34
-7,200
bdf48184b6b72c1b914f7a256f559bb022a803ec
[native] codeVersion -> 142
[ { "change_type": "MODIFY", "old_path": "native/android/app/build.gradle", "new_path": "native/android/app/build.gradle", "diff": "@@ -434,8 +434,8 @@ android {\napplicationId 'app.comm.android'\nminSdkVersion rootProject.ext.minSdkVersion\ntargetSdkVersion rootProject.ext.targetSdkVersion\n- versionCode 141\n- versionName '1.0.141'\n+ versionCode 142\n+ versionName '1.0.142'\nmissingDimensionStrategy 'react-native-camera', 'general'\nmultiDexEnabled true\n}\n" }, { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "new_path": "native/cpp/CommonCpp/NativeModules/CommCoreModule.h", "diff": "@@ -13,7 +13,7 @@ namespace comm {\nnamespace jsi = facebook::jsi;\nclass CommCoreModule : public facebook::react::CommCoreModuleSchemaCxxSpecJSI {\n- const int codeVersion{141};\n+ const int codeVersion{142};\nstd::unique_ptr<WorkerThread> databaseThread;\nstd::unique_ptr<WorkerThread> cryptoThread;\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.debug.plist", "new_path": "native/ios/Comm/Info.debug.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.141</string>\n+ <string>1.0.142</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>141</string>\n+ <string>142</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" }, { "change_type": "MODIFY", "old_path": "native/ios/Comm/Info.release.plist", "new_path": "native/ios/Comm/Info.release.plist", "diff": "<key>CFBundlePackageType</key>\n<string>APPL</string>\n<key>CFBundleShortVersionString</key>\n- <string>1.0.141</string>\n+ <string>1.0.142</string>\n<key>CFBundleSignature</key>\n<string>????</string>\n<key>CFBundleVersion</key>\n- <string>141</string>\n+ <string>142</string>\n<key>LSApplicationQueriesSchemes</key>\n<array>\n<string>org-appextension-feature-password-management</string>\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] codeVersion -> 142
129,200
18.08.2022 17:22:00
14,400
84f51ba2ce9e76d7ce69bc628284ebfc12f7393f
[native] enum for grpc client data Summary: We will pass this enum as a param to the login helper functions to distinguish between the registration and login workflows. Depends on D4876 Test Plan: `cargo build` (dead code) Reviewers: tomek, karol, atul Subscribers: ashoat, abosh
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs", "new_path": "native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs", "diff": "@@ -373,3 +373,8 @@ struct LoginResponseAndSender {\nresponse: Option<LoginResponse>,\nsender: mpsc::Sender<LoginRequest>,\n}\n+\n+enum ResponseAndSender {\n+ Registration(RegistrationResponseAndSender),\n+ Login(LoginResponseAndSender),\n+}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] enum for grpc client data Summary: We will pass this enum as a param to the login helper functions to distinguish between the registration and login workflows. Depends on D4876 Test Plan: `cargo build` (dead code) Reviewers: tomek, karol, atul Reviewed By: tomek Subscribers: ashoat, abosh Differential Revision: https://phab.comm.dev/D4878
129,200
22.08.2022 23:48:35
14,400
e46754ceabfd9392f1ab7701ac57168b8325b5ec
[native] introduce generic for unexpected response handler Summary: Since this function just logs the unexpected message and returns a gRPC Status, we can make it generic Depends on D4904 Test Plan: `cargo build` (very small refactor) Reviewers: tomek, karol, atul Subscribers: ashoat, abosh
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs", "new_path": "native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs", "diff": "@@ -263,8 +263,8 @@ fn pake_login_finish(\n.map(|res| res.message)\n}\n-fn handle_unexpected_registration_response(\n- message: Option<RegistrationResponseMessage>,\n+fn handle_unexpected_response<T: std::fmt::Debug>(\n+ message: Option<T>,\n) -> Status {\nerror!(\"Received an unexpected message: {:?}\", message);\nStatus::invalid_argument(\"Invalid response data\")\n@@ -312,7 +312,7 @@ async fn handle_registration_response(\n}\nOk(client_login_start_result.state)\n} else {\n- Err(handle_unexpected_registration_response(message))\n+ Err(handle_unexpected_response(message))\n}\n}\n@@ -340,7 +340,7 @@ async fn handle_credential_response(\n};\nsend_to_mpsc(tx, registration_request).await\n} else {\n- Err(handle_unexpected_registration_response(message))\n+ Err(handle_unexpected_response(message))\n}\n}\n@@ -356,7 +356,7 @@ fn handle_token_response(\n{\nOk(access_token)\n} else {\n- Err(handle_unexpected_registration_response(message))\n+ Err(handle_unexpected_response(message))\n}\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] introduce generic for unexpected response handler Summary: Since this function just logs the unexpected message and returns a gRPC Status, we can make it generic Depends on D4904 Test Plan: `cargo build` (very small refactor) Reviewers: tomek, karol, atul Reviewed By: tomek Subscribers: ashoat, abosh Differential Revision: https://phab.comm.dev/D4905
129,200
23.08.2022 14:30:42
14,400
5758a7b045ce3e56398a58c477e534b881255a2b
[native] pake login method for gRPC client Summary: Uses the existing helper functions to log a user in using PAKE. Test Plan: successfully logged in an existing user by calling method Reviewers: tomek, karol, atul Subscribers: ashoat, abosh
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs", "new_path": "native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs", "diff": "@@ -21,6 +21,7 @@ use crate::identity::{\nlogin_request::Data::PakeLoginRequest,\nlogin_response::Data::PakeLoginResponse as LoginPakeLoginResponse,\npake_login_request::Data::PakeCredentialFinalization as LoginPakeCredentialFinalization,\n+ pake_login_request::Data::PakeCredentialRequestAndUserId,\npake_login_response::Data::AccessToken,\npake_login_response::Data::PakeCredentialResponse,\nregistration_request::Data::PakeCredentialFinalization as RegistrationPakeCredentialFinalization,\n@@ -29,6 +30,7 @@ use crate::identity::{\nregistration_response::Data::PakeLoginResponse as RegistrationPakeLoginResponse,\nregistration_response::Data::PakeRegistrationResponse, GetUserIdRequest,\nGetUserIdResponse, LoginRequest, LoginResponse,\n+ PakeCredentialRequestAndUserId as PakeCredentialRequestAndUserIdStruct,\nPakeLoginRequest as PakeLoginRequestStruct,\nPakeLoginResponse as PakeLoginResponseStruct,\nPakeRegistrationRequestAndUserId as PakeRegistrationRequestAndUserIdStruct,\n@@ -173,6 +175,67 @@ impl Client {\nlet message = response.message().await?;\nhandle_registration_token_response(message)\n}\n+\n+ #[instrument(skip(self))]\n+ async fn login_user_pake(\n+ &mut self,\n+ user_id: String,\n+ device_id: String,\n+ password: String,\n+ ) -> Result<String, Status> {\n+ // Create a LoginRequest channel and use ReceiverStream to turn the\n+ // MPSC receiver into a Stream for outbound messages\n+ let (tx, rx) = mpsc::channel(1);\n+ let stream = ReceiverStream::new(rx);\n+ let request = Request::new(stream);\n+\n+ // `response` is the Stream for inbound messages\n+ let mut response =\n+ self.identity_client.login_user(request).await?.into_inner();\n+\n+ // Start PAKE login on client and send initial login request to Identity\n+ // service\n+ let mut client_rng = OsRng;\n+ let client_login_start_result =\n+ pake_login_start(&mut client_rng, &password)?;\n+ let login_request = LoginRequest {\n+ data: Some(PakeLoginRequest(PakeLoginRequestStruct {\n+ data: Some(PakeCredentialRequestAndUserId(\n+ PakeCredentialRequestAndUserIdStruct {\n+ user_id,\n+ device_id,\n+ pake_credential_request: client_login_start_result\n+ .message\n+ .serialize()\n+ .map_err(|e| {\n+ error!(\"Could not serialize credential request: {}\", e);\n+ Status::failed_precondition(\"PAKE failure\")\n+ })?,\n+ },\n+ )),\n+ })),\n+ };\n+ if let Err(e) = tx.send(login_request).await {\n+ error!(\"Response was dropped: {}\", e);\n+ return Err(Status::aborted(\"Dropped response\"));\n+ }\n+\n+ // Handle responses from Identity service sequentially, making sure we get\n+ // messages in the correct order\n+\n+ // Finish PAKE login; send final login request to Identity service\n+ let message = response.message().await?;\n+ handle_login_credential_response(\n+ message,\n+ client_login_start_result.state,\n+ tx,\n+ )\n+ .await?;\n+\n+ // Return access token\n+ let message = response.message().await?;\n+ handle_login_token_response(message)\n+ }\n}\nfn pake_registration_start(\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] pake login method for gRPC client Summary: Uses the existing helper functions to log a user in using PAKE. Test Plan: successfully logged in an existing user by calling method Reviewers: tomek, karol, atul Reviewed By: tomek Subscribers: ashoat, abosh Differential Revision: https://phab.comm.dev/D4927
129,182
25.08.2022 11:32:59
-7,200
9c3ebbf367e774b173474dfe3f448d855978a9c6
[web] Add device ID to redux Summary: Add device ID to redux on web so it can be persisted. Test Plan: Check with redux tools that the ID is indeed present in the redux store. Reviewers: tomek, atul, max, jacek, ashoat Subscribers: ashoat, abosh
[ { "change_type": "MODIFY", "old_path": "keyserver/src/responders/website-responders.js", "new_path": "keyserver/src/responders/website-responders.js", "diff": "@@ -299,6 +299,7 @@ async function websiteResponder(\nconst statePromises = {\nnavInfo: navInfoPromise,\n+ deviceID: null,\ncurrentUserInfo: ((currentUserInfoPromise: any): Promise<CurrentUserInfo>),\nsessionID: sessionIDPromise,\nentryStore: entryStorePromise,\n" }, { "change_type": "MODIFY", "old_path": "web/redux/action-types.js", "new_path": "web/redux/action-types.js", "diff": "// @flow\nexport const updateWindowActiveActionType = 'UPDATE_WINDOW_ACTIVE';\n+export const setDeviceIDActionType = 'SET_DEVICE_ID';\n" }, { "change_type": "ADD", "old_path": null, "new_path": "web/redux/device-id-reducer.js", "diff": "+// @flow\n+\n+import type { Action } from '../redux/redux-setup';\n+import { deviceIDCharLength } from '../utils//device-id';\n+import { setDeviceIDActionType } from './action-types';\n+\n+const deviceIDRegex = new RegExp(\n+ `^(ks|mobile|web):[a-zA-Z0-9]{${deviceIDCharLength.toString()}}$`,\n+);\n+\n+export function reduceDeviceID(state: ?string, action: Action): ?string {\n+ if (action.type === setDeviceIDActionType) {\n+ if (action.payload?.match(deviceIDRegex)) {\n+ return action.payload;\n+ }\n+ return null;\n+ }\n+ return state;\n+}\n" }, { "change_type": "MODIFY", "old_path": "web/redux/redux-setup.js", "new_path": "web/redux/redux-setup.js", "diff": "@@ -27,13 +27,18 @@ import { setNewSessionActionType } from 'lib/utils/action-utils';\nimport { activeThreadSelector } from '../selectors/nav-selectors';\nimport { type NavInfo, updateNavInfoActionType } from '../types/nav-types';\n-import { updateWindowActiveActionType } from './action-types';\n+import {\n+ updateWindowActiveActionType,\n+ setDeviceIDActionType,\n+} from './action-types';\n+import { reduceDeviceID } from './device-id-reducer';\nimport reduceNavInfo from './nav-reducer';\nimport { getVisibility } from './visibility';\nexport type WindowDimensions = { width: number, height: number };\nexport type AppState = {\nnavInfo: NavInfo,\n+ deviceID: ?string,\ncurrentUserInfo: ?CurrentUserInfo,\nsessionID: ?string,\nentryStore: EntryStore,\n@@ -73,6 +78,10 @@ export type Action =\n| {\ntype: 'UPDATE_WINDOW_ACTIVE',\npayload: boolean,\n+ }\n+ | {\n+ type: 'SET_DEVICE_ID',\n+ payload: string,\n};\nexport function reducer(oldState: AppState | void, action: Action): AppState {\n@@ -120,7 +129,10 @@ export function reducer(oldState: AppState | void, action: Action): AppState {\nreturn oldState;\n}\n- if (action.type !== updateNavInfoActionType) {\n+ if (\n+ action.type !== updateNavInfoActionType &&\n+ action.type !== setDeviceIDActionType\n+ ) {\nstate = baseReducer(state, action).state;\n}\n@@ -131,6 +143,7 @@ export function reducer(oldState: AppState | void, action: Action): AppState {\naction,\nstate.threadStore.threadInfos,\n),\n+ deviceID: reduceDeviceID(state.deviceID, action),\n};\nreturn validateState(oldState, state);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] Add device ID to redux Summary: Add device ID to redux on web so it can be persisted. Test Plan: Check with redux tools that the ID is indeed present in the redux store. Reviewers: tomek, atul, max, jacek, ashoat Reviewed By: tomek, max, ashoat Subscribers: ashoat, abosh Differential Revision: https://phab.comm.dev/D4868
129,182
25.08.2022 11:32:59
-7,200
e6b6eeef7b00fcfc22f80709ac1342fb4969f20c
[web] refactor device-ID-regex-related code Summary: In response to comments on D4868 I refactored code ralated to device ID regex Test Plan: Run `yarn test` on web Reviewers: tomek, ashoat Subscribers: atul, abosh
[ { "change_type": "MODIFY", "old_path": "services/tunnelbroker/src/Constants.h", "new_path": "services/tunnelbroker/src/Constants.h", "diff": "@@ -44,6 +44,8 @@ const size_t AMQP_RECONNECT_MAX_ATTEMPTS = 10;\n// DEVICEID_CHAR_LENGTH has to be kept in sync with deviceIDCharLength\n// which is defined in web/utils/device-id.js\nconst size_t DEVICEID_CHAR_LENGTH = 64;\n+// DEVICEID_FORMAT_REGEX has to be kept in sync with deviceIDFormatRegex\n+// which is defined in web/utils/device-id.js\nconst std::regex DEVICEID_FORMAT_REGEX(\n\"^(ks|mobile|web):[a-zA-Z0-9]{\" + std::to_string(DEVICEID_CHAR_LENGTH) +\n\"}$\");\n" }, { "change_type": "MODIFY", "old_path": "web/redux/device-id-reducer.js", "new_path": "web/redux/device-id-reducer.js", "diff": "// @flow\nimport type { Action } from '../redux/redux-setup';\n-import { deviceIDCharLength } from '../utils//device-id';\n+import { deviceIDFormatRegex } from '../utils/device-id';\nimport { setDeviceIDActionType } from './action-types';\n-const deviceIDRegex = new RegExp(\n- `^(ks|mobile|web):[a-zA-Z0-9]{${deviceIDCharLength.toString()}}$`,\n-);\n-\nexport function reduceDeviceID(state: ?string, action: Action): ?string {\nif (action.type === setDeviceIDActionType) {\n- if (action.payload?.match(deviceIDRegex)) {\n+ if (action.payload?.match(deviceIDFormatRegex)) {\nreturn action.payload;\n}\nreturn null;\n" }, { "change_type": "MODIFY", "old_path": "web/utils/device-id.js", "new_path": "web/utils/device-id.js", "diff": "@@ -16,6 +16,11 @@ const alphanumeric =\n// deviceIDCharLength has to be kept in sync with DEVICEID_CHAR_LENGTH\n// which is defined in services/tunnelbroker/src/Constants.h\nconst deviceIDCharLength = 64;\n+// deviceIDFormatRegex has to be kept in sync with DEVICEID_FORMAT_REGEX\n+// which is defined in services/tunnelbroker/src/Constants.h\n+const deviceIDFormatRegex: RegExp = new RegExp(\n+ `^(ks|mobile|web):[a-zA-Z0-9]{${deviceIDCharLength.toString()}}$`,\n+);\nfunction generateDeviceID(type: DeviceIDType): string {\nconst suffix = generateRandomString(deviceIDCharLength, alphanumeric);\n@@ -30,4 +35,9 @@ function generateDeviceID(type: DeviceIDType): string {\ninvariant(false, `Unhandled device type ${type}`);\n}\n-export { generateDeviceID, deviceIDCharLength, deviceIDTypes };\n+export {\n+ generateDeviceID,\n+ deviceIDCharLength,\n+ deviceIDTypes,\n+ deviceIDFormatRegex,\n+};\n" }, { "change_type": "MODIFY", "old_path": "web/utils/device-id.test.js", "new_path": "web/utils/device-id.test.js", "diff": "@@ -4,17 +4,17 @@ import {\ngenerateDeviceID,\ndeviceIDCharLength,\ndeviceIDTypes,\n+ deviceIDFormatRegex,\n} from './device-id';\ndescribe('generateDeviceID', () => {\n- const baseRegExp = new RegExp(\n- `^(ks|mobile|web):[a-zA-Z0-9]{${deviceIDCharLength.toString()}}$`,\n- );\nit(\n'passed deviceIDTypes.KEYSERVER retruns a randomly generated string, ' +\n'subject to ^(ks|mobile|web):[a-zA-Z0-9]{DEVICEID_CHAR_LENGTH}$',\n() => {\n- expect(generateDeviceID(deviceIDTypes.KEYSERVER)).toMatch(baseRegExp);\n+ expect(generateDeviceID(deviceIDTypes.KEYSERVER)).toMatch(\n+ deviceIDFormatRegex,\n+ );\n},\n);\n@@ -22,7 +22,7 @@ describe('generateDeviceID', () => {\n'passed deviceIDTypes.WEB retruns a randomly generated string, ' +\n'subject to ^(ks|mobile|web):[a-zA-Z0-9]{DEVICEID_CHAR_LENGTH}$',\n() => {\n- expect(generateDeviceID(deviceIDTypes.WEB)).toMatch(baseRegExp);\n+ expect(generateDeviceID(deviceIDTypes.WEB)).toMatch(deviceIDFormatRegex);\n},\n);\n@@ -30,7 +30,9 @@ describe('generateDeviceID', () => {\n'passed deviceIDTypes.MOBILE retruns a randomly generated string, ' +\n'subject to ^(ks|mobile|web):[a-zA-Z0-9]{DEVICEID_CHAR_LENGTH}$',\n() => {\n- expect(generateDeviceID(deviceIDTypes.MOBILE)).toMatch(baseRegExp);\n+ expect(generateDeviceID(deviceIDTypes.MOBILE)).toMatch(\n+ deviceIDFormatRegex,\n+ );\n},\n);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] refactor device-ID-regex-related code Summary: In response to comments on D4868 I refactored code ralated to device ID regex Test Plan: Run `yarn test` on web Reviewers: tomek, ashoat Reviewed By: tomek, ashoat Subscribers: atul, abosh Differential Revision: https://phab.comm.dev/D4883
129,200
24.08.2022 17:12:32
14,400
e06b3c38cc103b9705896fc5accecaccb9776742
[native] add c++11 flag to build Summary: this ensures that the compiler knows which edition of C++ to use. Test Plan: `cargo build` Reviewers: tomek, karol, atul Subscribers: ashoat, abosh
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/grpc/grpc_client/build.rs", "new_path": "native/cpp/CommonCpp/grpc/grpc_client/build.rs", "diff": "fn main() {\ntonic_build::compile_protos(\"../protos/identity.proto\")\n.unwrap_or_else(|e| panic!(\"Failed to compile protos {:?}\", e));\n- let _cxx_build = cxx_build::bridge(\"src/lib.rs\");\n+ let _cxx_build =\n+ cxx_build::bridge(\"src/lib.rs\").flag_if_supported(\"-std=c++11\");\nprintln!(\"cargo:rerun-if-changed=src/hello.c\");\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] add c++11 flag to build Summary: this ensures that the compiler knows which edition of C++ to use. Test Plan: `cargo build` Reviewers: tomek, karol, atul Reviewed By: atul Subscribers: ashoat, abosh Differential Revision: https://phab.comm.dev/D4950
129,200
25.08.2022 07:05:26
14,400
3b5ea22263b57b56b5bccbf657665281dec15d74
[native] remove unused types Summary: Introduced some types with the intention of simplifying our code but it proved too difficult. Removing them for now since they're unused. Depends on D4950 Test Plan: `cargo build` Reviewers: tomek, karol, atul Subscribers: ashoat, abosh
[ { "change_type": "MODIFY", "old_path": "native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs", "new_path": "native/cpp/CommonCpp/grpc/grpc_client/src/lib.rs", "diff": "@@ -98,12 +98,6 @@ mod ffi {\n}\n}\n-#[derive(Debug)]\n-enum AuthType {\n- Password = 0,\n- Wallet = 1,\n-}\n-\n#[derive(Debug)]\nstruct Client {\nidentity_client: IdentityServiceClient<Channel>,\n@@ -636,21 +630,6 @@ fn handle_wallet_login_response(\n}\n}\n-struct RegistrationResponseAndSender {\n- response: Option<RegistrationResponseMessage>,\n- sender: mpsc::Sender<RegistrationRequest>,\n-}\n-\n-struct LoginResponseAndSender {\n- response: Option<LoginResponse>,\n- sender: mpsc::Sender<LoginRequest>,\n-}\n-\n-enum ResponseAndSender {\n- Registration(RegistrationResponseAndSender),\n- Login(LoginResponseAndSender),\n-}\n-\nasync fn send_to_mpsc<T>(\ntx: mpsc::Sender<T>,\nrequest: T,\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] remove unused types Summary: Introduced some types with the intention of simplifying our code but it proved too difficult. Removing them for now since they're unused. Depends on D4950 Test Plan: `cargo build` Reviewers: tomek, karol, atul Reviewed By: atul Subscribers: ashoat, abosh Differential Revision: https://phab.comm.dev/D4951
129,203
23.08.2022 17:09:25
14,400
24746e00189dbf1643fe52f66459b474cfe565f0
[web] Memoize `loginButtonContent` and `saveButtonContent` Summary: Noticed these could be memoized. Test Plan: Made sure everything looked as expected on the `LogInForm` modal and `ThreadSettingsGeneralTab` save button. Loading indicators showed up correctly, disappeared after submit was complete, etc. Reviewers: atul Subscribers: ashoat, tomek
[ { "change_type": "MODIFY", "old_path": "web/account/log-in-form.react.js", "new_path": "web/account/log-in-form.react.js", "diff": "@@ -113,12 +113,12 @@ function LoginForm(): React.Node {\n[dispatchActionPromise, logInAction, loginExtraInfo, username],\n);\n- let loginButtonContent;\n+ const loginButtonContent = React.useMemo(() => {\nif (inputDisabled) {\n- loginButtonContent = <LoadingIndicator status=\"loading\" />;\n- } else {\n- loginButtonContent = 'Log in';\n+ return <LoadingIndicator status=\"loading\" />;\n}\n+ return 'Log in';\n+ }, [inputDisabled]);\nreturn (\n<div className={css['modal-body']}>\n" }, { "change_type": "MODIFY", "old_path": "web/modals/threads/settings/thread-settings-general-tab.react.js", "new_path": "web/modals/threads/settings/thread-settings-general-tab.react.js", "diff": "@@ -137,12 +137,12 @@ function ThreadSettingsGeneralTab(\nthreadPermissions.EDIT_THREAD_NAME,\n);\n- let loginButtonContent;\n+ const saveButtonContent = React.useMemo(() => {\nif (threadSettingsOperationInProgress) {\n- loginButtonContent = <LoadingIndicator status=\"loading\" />;\n- } else {\n- loginButtonContent = 'Save';\n+ return <LoadingIndicator status=\"loading\" />;\n}\n+ return 'Save';\n+ }, [threadSettingsOperationInProgress]);\nreturn (\n<form method=\"POST\">\n@@ -188,7 +188,7 @@ function ThreadSettingsGeneralTab(\ndisabled={threadSettingsOperationInProgress || !changeQueued}\nclassName={css.save_button}\n>\n- {loginButtonContent}\n+ {saveButtonContent}\n</Button>\n</form>\n);\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] Memoize `loginButtonContent` and `saveButtonContent` Summary: Noticed these could be memoized. Test Plan: Made sure everything looked as expected on the `LogInForm` modal and `ThreadSettingsGeneralTab` save button. Loading indicators showed up correctly, disappeared after submit was complete, etc. Reviewers: atul Reviewed By: atul Subscribers: ashoat, tomek Differential Revision: https://phab.comm.dev/D4930
129,203
23.08.2022 17:32:10
14,400
669f84ba59ecdfce4d98fe92ce7a9560cb58605d
[web] Simplify `return` value of `changeThreadSettingsAction` Summary: Noticed this when reading through [[ | feedback ]] on D4416 when requesting review on D4931. Looks like I forgot to add this in after he accepted! Test Plan: Flow, feedback Reviewers: tomek, atul Subscribers: ashoat, tomek
[ { "change_type": "MODIFY", "old_path": "web/modals/threads/settings/thread-settings-general-tab.react.js", "new_path": "web/modals/threads/settings/thread-settings-general-tab.react.js", "diff": "@@ -103,11 +103,10 @@ function ThreadSettingsGeneralTab(\nconst changeThreadSettingsAction = React.useCallback(async () => {\ntry {\nsetErrorMessage('');\n- const response = await callChangeThreadSettings({\n+ return await callChangeThreadSettings({\nthreadID: threadInfo.id,\nchanges: queuedChanges,\n});\n- return response;\n} catch (e) {\nsetErrorMessage('unknown_error');\nsetQueuedChanges(Object.freeze({}));\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[web] Simplify `return` value of `changeThreadSettingsAction` Summary: Noticed this when reading through @tomek's [[ https://phab.comm.dev/D4416?id=14041#inline-27509 | feedback ]] on D4416 when requesting review on D4931. Looks like I forgot to add this in after he accepted! Test Plan: Flow, @tomek's feedback Reviewers: tomek, atul Reviewed By: atul Subscribers: ashoat, tomek Differential Revision: https://phab.comm.dev/D4932
129,203
19.08.2022 17:11:25
14,400
7f7f5ebfdd115b1cd463419711c273d1280f748b
[native] Use `Array.some(...)` in `uploadInProgress` Summary: Depends on D4890. Minor change that avoids another level of indentation/for loop by using [[ | Array.some(...) ]]. Test Plan: Flow, close reading. Reviewers: atul, tomek, jacek Subscribers: ashoat
[ { "change_type": "MODIFY", "old_path": "native/input/input-state-container.react.js", "new_path": "native/input/input-state-container.react.js", "diff": "@@ -372,13 +372,14 @@ class InputStateContainer extends React.PureComponent<Props, State> {\n}\nfor (const localMessageID in this.state.pendingUploads) {\nconst messagePendingUploads = this.state.pendingUploads[localMessageID];\n- for (const localUploadID in messagePendingUploads) {\n- const { failed } = messagePendingUploads[localUploadID];\n- if (!failed) {\n+ if (\n+ Object.keys(messagePendingUploads).some(\n+ localUploadID => !messagePendingUploads[localUploadID].failed,\n+ )\n+ ) {\nreturn true;\n}\n}\n- }\nreturn false;\n};\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Use `Array.some(...)` in `uploadInProgress` Summary: Depends on D4890. Minor change that avoids another level of indentation/for loop by using [[ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some | Array.some(...) ]]. Test Plan: Flow, close reading. Reviewers: atul, tomek, jacek Reviewed By: tomek Subscribers: ashoat Differential Revision: https://phab.comm.dev/D4892
129,203
25.08.2022 13:50:21
14,400
c3c3ab6a16f7de1c434baf8b092f8b9d6e2538c3
[native] Make return value more concise in `uploadInProgress` Summary: Super quick change that depends on D4892. Test Plan: Flow, close reading. Unfortunately cannot use `Object.values(...)` because of Flow errors. Reviewers: atul, tomek Subscribers: ashoat
[ { "change_type": "MODIFY", "old_path": "native/input/input-state-container.react.js", "new_path": "native/input/input-state-container.react.js", "diff": "@@ -370,17 +370,13 @@ class InputStateContainer extends React.PureComponent<Props, State> {\nif (this.props.ongoingMessageCreation) {\nreturn true;\n}\n- for (const localMessageID in this.state.pendingUploads) {\n- const messagePendingUploads = this.state.pendingUploads[localMessageID];\n- if (\n- Object.keys(messagePendingUploads).some(\n+ const { pendingUploads } = this.state;\n+ return Object.keys(pendingUploads).some(localMessageID => {\n+ const messagePendingUploads = pendingUploads[localMessageID];\n+ return Object.keys(messagePendingUploads).some(\nlocalUploadID => !messagePendingUploads[localUploadID].failed,\n- )\n- ) {\n- return true;\n- }\n- }\n- return false;\n+ );\n+ });\n};\nsendTextMessage = async (\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[native] Make return value more concise in `uploadInProgress` Summary: Super quick change that depends on D4892. Test Plan: Flow, close reading. Unfortunately cannot use `Object.values(...)` because of Flow errors. Reviewers: atul, tomek Reviewed By: tomek Subscribers: ashoat Differential Revision: https://phab.comm.dev/D4955
129,190
29.08.2022 15:56:52
-7,200
15ddad8a568884ed06d7f09a3736315353da85b1
[services] Backup - Rust lib - Add is initialized Summary: Depends on D4861 Adding a function that checks whether the client's been initialized Test Plan: test plan in D4870 Reviewers: varun, tomek, ashoat Subscribers: ashoat, tomek, atul, abosh
[ { "change_type": "MODIFY", "old_path": ".gitignore", "new_path": ".gitignore", "diff": "@@ -34,3 +34,4 @@ services/lib/src/build\n# Nix\nresult*\n+services/backup/rust_lib/target/\n" }, { "change_type": "MODIFY", "old_path": "services/backup/rust_lib/Cargo.lock", "new_path": "services/backup/rust_lib/Cargo.lock", "diff": "# It is not intended for manual editing.\nversion = 3\n+[[package]]\n+name = \"autocfg\"\n+version = \"1.1.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa\"\n+\n[[package]]\nname = \"cc\"\nversion = \"1.0.73\"\n@@ -62,6 +68,33 @@ dependencies = [\n\"syn\",\n]\n+[[package]]\n+name = \"futures-core\"\n+version = \"0.3.23\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"d2acedae88d38235936c3922476b10fced7b2b68136f5e3c03c2d5be348a1115\"\n+\n+[[package]]\n+name = \"hermit-abi\"\n+version = \"0.1.19\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33\"\n+dependencies = [\n+ \"libc\",\n+]\n+\n+[[package]]\n+name = \"lazy_static\"\n+version = \"1.4.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646\"\n+\n+[[package]]\n+name = \"libc\"\n+version = \"0.2.132\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5\"\n+\n[[package]]\nname = \"link-cplusplus\"\nversion = \"1.0.6\"\n@@ -71,12 +104,28 @@ dependencies = [\n\"cc\",\n]\n+[[package]]\n+name = \"num_cpus\"\n+version = \"1.13.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1\"\n+dependencies = [\n+ \"hermit-abi\",\n+ \"libc\",\n+]\n+\n[[package]]\nname = \"once_cell\"\nversion = \"1.13.0\"\nsource = \"registry+https://github.com/rust-lang/crates.io-index\"\nchecksum = \"18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1\"\n+[[package]]\n+name = \"pin-project-lite\"\n+version = \"0.2.9\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116\"\n+\n[[package]]\nname = \"proc-macro2\"\nversion = \"1.0.43\"\n@@ -101,6 +150,10 @@ version = \"0.1.0\"\ndependencies = [\n\"cxx\",\n\"cxx-build\",\n+ \"lazy_static\",\n+ \"libc\",\n+ \"tokio\",\n+ \"tokio-stream\",\n]\n[[package]]\n@@ -129,6 +182,41 @@ dependencies = [\n\"winapi-util\",\n]\n+[[package]]\n+name = \"tokio\"\n+version = \"1.20.1\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581\"\n+dependencies = [\n+ \"autocfg\",\n+ \"num_cpus\",\n+ \"once_cell\",\n+ \"pin-project-lite\",\n+ \"tokio-macros\",\n+]\n+\n+[[package]]\n+name = \"tokio-macros\"\n+version = \"1.8.0\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484\"\n+dependencies = [\n+ \"proc-macro2\",\n+ \"quote\",\n+ \"syn\",\n+]\n+\n+[[package]]\n+name = \"tokio-stream\"\n+version = \"0.1.9\"\n+source = \"registry+https://github.com/rust-lang/crates.io-index\"\n+checksum = \"df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9\"\n+dependencies = [\n+ \"futures-core\",\n+ \"pin-project-lite\",\n+ \"tokio\",\n+]\n+\n[[package]]\nname = \"unicode-ident\"\nversion = \"1.0.3\"\n" }, { "change_type": "MODIFY", "old_path": "services/backup/rust_lib/Cargo.toml", "new_path": "services/backup/rust_lib/Cargo.toml", "diff": "@@ -5,6 +5,10 @@ edition = \"2021\"\n[dependencies]\ncxx = \"1.0\"\n+tokio = { version = \"1.20\", features = [\"macros\", \"rt-multi-thread\"] }\n+tokio-stream = \"0.1\"\n+lazy_static = \"1.4\"\n+libc = \"0.2\"\n[build-dependencies]\ncxx-build = \"1.0\"\n" }, { "change_type": "ADD", "old_path": null, "new_path": "services/backup/rust_lib/src/constants.rs", "diff": "+pub const MPSC_CHANNEL_BUFFER_CAPACITY: usize = 1;\n" }, { "change_type": "MODIFY", "old_path": "services/backup/rust_lib/src/lib.rs", "new_path": "services/backup/rust_lib/src/lib.rs", "diff": "#[cxx::bridge]\nmod ffi {\nextern \"Rust\" {\n- fn test_function() -> i32;\n+ fn rust_is_initialized_cxx() -> bool;\n+ fn rust_initialize_cxx() -> ();\n+ unsafe fn rust_process_cxx(_: *const c_char) -> ();\n+ fn rust_terminate_cxx() -> ();\n}\n}\n-pub fn test_function() -> i32 {\n- 0\n+use lazy_static::lazy_static;\n+use libc;\n+use libc::c_char;\n+use std::sync::{Arc, Mutex};\n+use tokio::runtime::Runtime;\n+use tokio::sync::mpsc;\n+use tokio::task::JoinHandle;\n+\n+pub struct Client {\n+ tx: Option<mpsc::Sender<String>>,\n+ handle: Option<JoinHandle<()>>,\n+}\n+\n+lazy_static! {\n+ pub static ref CLIENT: Arc<Mutex<Client>> = Arc::new(Mutex::new(Client {\n+ tx: None,\n+ handle: None\n+ }));\n+ pub static ref RUNTIME: Runtime = Runtime::new().unwrap();\n+}\n+\n+pub fn rust_is_initialized_cxx() -> bool {\n+ if CLIENT.lock().expect(\"access client\").tx.is_none() {\n+ return false;\n+ }\n+ if CLIENT.lock().expect(\"access client\").handle.is_none() {\n+ return false;\n+ }\n+ return true;\n+}\n+\n+pub fn rust_initialize_cxx() -> () {\n+ unimplemented!();\n+}\n+\n+pub fn rust_process_cxx(_: *const c_char) -> () {\n+ unimplemented!();\n+}\n+\n+pub fn rust_terminate_cxx() -> () {\n+ unimplemented!();\n}\n" } ]
JavaScript
BSD 3-Clause New or Revised License
comme2e/comm
[services] Backup - Rust lib - Add is initialized Summary: Depends on D4861 Adding a function that checks whether the client's been initialized Test Plan: test plan in D4870 Reviewers: varun, tomek, ashoat Reviewed By: varun, tomek, ashoat Subscribers: ashoat, tomek, atul, abosh Differential Revision: https://phab.comm.dev/D4884