From e0ff99ff6e7752190747ba8339449b9f4d1603c2 Mon Sep 17 00:00:00 2001 From: Christoph Proeschel Date: Mon, 24 Oct 2022 13:57:20 +0200 Subject: [PATCH] [#3836] Hotfix crashing whatsapp (#3876) --- VERSION | 2 +- backend/components/rasa/helm/BUILD | 29 +-------- .../co/airy/core/sources/whatsapp/Stores.java | 6 +- .../resources/application.properties | 0 .../whatsapp/helm/templates/deployments.yaml | 11 ++++ docs/docs/changelog.md | 65 ++++--------------- 6 files changed, 31 insertions(+), 82 deletions(-) rename backend/components/whatsapp/connector/src/main/{java => }/resources/application.properties (100%) diff --git a/VERSION b/VERSION index 564edf82dd..a3968efc37 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.50.0 +0.50.1 diff --git a/backend/components/rasa/helm/BUILD b/backend/components/rasa/helm/BUILD index 1f602ed4a8..45805d5f1c 100644 --- a/backend/components/rasa/helm/BUILD +++ b/backend/components/rasa/helm/BUILD @@ -1,28 +1,3 @@ -load("@rules_pkg//:pkg.bzl", "pkg_tar") -load("@com_github_airyhq_bazel_tools//helm:helm.bzl", "helm_template_test") -load("//tools/build:helm.bzl", "helm_push") +load("//tools/build:helm.bzl", "helm_ruleset_core_version") -filegroup( - name = "files", - srcs = glob( - ["**/*"], - exclude = ["BUILD"], - ), - visibility = ["//visibility:public"], -) - -pkg_tar( - name = "package", - srcs = [":files"], - extension = "tgz", - strip_prefix = "./", -) - -helm_template_test( - name = "template", - chart = ":package", -) - -helm_push( - chart = ":package", -) +helm_ruleset_core_version() diff --git a/backend/components/whatsapp/connector/src/main/java/co/airy/core/sources/whatsapp/Stores.java b/backend/components/whatsapp/connector/src/main/java/co/airy/core/sources/whatsapp/Stores.java index 439b046a10..cd0a15c0e8 100644 --- a/backend/components/whatsapp/connector/src/main/java/co/airy/core/sources/whatsapp/Stores.java +++ b/backend/components/whatsapp/connector/src/main/java/co/airy/core/sources/whatsapp/Stores.java @@ -75,17 +75,17 @@ public void onApplicationEvent(ApplicationStartedEvent applicationStartedEvent) // Foreign key join on channels so that we have channels information for marking messages read final KTable messagesWithChannel = messageStream.toTable().join(channelsTable, Message::getChannelId, - (message, channel) -> MessageWithChannel.builder().channel(channel).message(message).build()); + (message, channel) -> MessageWithChannel.builder().channel(channel).message(message).build()); // Contact messages table for marking them as read final KTable markMessageReadTable = metadataStream - .filter((id, metadata) -> metadata.getKey().equals(MetadataKeys.MessageKeys.Source.ID)) + .filter((id, metadata) -> metadata != null && metadata.getKey().equals(MetadataKeys.MessageKeys.Source.ID)) .groupBy((id, metadata) -> getSubject(metadata).getIdentifier()) .reduce((v1, v2) -> v2) .join(messagesWithChannel, (metadata, messageWithChannel) -> messageWithChannel.toBuilder().sourceMessageId(metadata.getValue()).build()); - metadataStream.filter((id, metadata) -> metadata.getKey().equals(MetadataKeys.MessageKeys.READ_BY_USER)) + metadataStream.filter((id, metadata) -> metadata != null && metadata.getKey().equals(MetadataKeys.MessageKeys.READ_BY_USER)) .selectKey((id, metadata) -> getSubject(metadata).getIdentifier()) .join(markMessageReadTable, (metadata, messageWithChannel) -> messageWithChannel) .peek((messageId, messageWithChannel) -> connector.markMessageRead(messageWithChannel)); diff --git a/backend/components/whatsapp/connector/src/main/java/resources/application.properties b/backend/components/whatsapp/connector/src/main/resources/application.properties similarity index 100% rename from backend/components/whatsapp/connector/src/main/java/resources/application.properties rename to backend/components/whatsapp/connector/src/main/resources/application.properties diff --git a/backend/components/whatsapp/helm/templates/deployments.yaml b/backend/components/whatsapp/helm/templates/deployments.yaml index a6289c8869..1fcbff4b11 100644 --- a/backend/components/whatsapp/helm/templates/deployments.yaml +++ b/backend/components/whatsapp/helm/templates/deployments.yaml @@ -37,6 +37,17 @@ spec: name: core-config - configMapRef: name: "{{ .Values.name }}" + env: + - name: REQUESTED_CPU + valueFrom: + resourceFieldRef: + containerName: app + resource: requests.cpu + - name: LIMIT_CPU + valueFrom: + resourceFieldRef: + containerName: app + resource: limits.cpu livenessProbe: httpGet: path: /actuator/health diff --git a/docs/docs/changelog.md b/docs/docs/changelog.md index e613e90412..7b638a7da7 100644 --- a/docs/docs/changelog.md +++ b/docs/docs/changelog.md @@ -3,6 +3,20 @@ title: Changelog sidebar_label: 📝 Changelog --- +## 0.50.1 + +#### Hotfix + +- [[#3868](https://github.com/airyhq/airy/issues/3868)] Fix Whatsapp component crash + +#### Airy CLI + +You can download the Airy CLI for your operating system from the following links: + +[MacOS](https://airy-core-binaries.s3.amazonaws.com/0.50.1/darwin/amd64/airy) +[Linux](https://airy-core-binaries.s3.amazonaws.com/0.50.1/linux/amd64/airy) +[Windows](https://airy-core-binaries.s3.amazonaws.com/0.50.1/windows/amd64/airy.exe) + ## 0.50.0 #### Changes @@ -1316,54 +1330,3 @@ You can download the Airy CLI for your operating system from the following links In the `airy.yaml` file, `host` is moved from the `kubernetes` section, into the `ingress` section. -## 0.30.0 - -#### 🚀 Features - -- [[#2274](https://github.com/airyhq/airy/issues/2274)] Introduce the source API [[#2327](https://github.com/airyhq/airy/pull/2327)] -- [[#2328](https://github.com/airyhq/airy/issues/2328)] Display any source in the inbox [[#2368](https://github.com/airyhq/airy/pull/2368)] -- [[#2227](https://github.com/airyhq/airy/issues/2227)] Instagram source show story reply in inbox UI [[#2367](https://github.com/airyhq/airy/pull/2367)] -- [[#2229](https://github.com/airyhq/airy/issues/2229)] Instagram source render story mention in inbox UI [[#2363](https://github.com/airyhq/airy/pull/2363)] - -#### 🐛 Bug Fixes - -- [[#2370](https://github.com/airyhq/airy/issues/2370)] Fix inbox counter bug when paginating [[#2371](https://github.com/airyhq/airy/pull/2371)] -- [[#2337](https://github.com/airyhq/airy/issues/2337)] Fix webhook publisher crash for deleted messages [[#2340](https://github.com/airyhq/airy/pull/2340)] -- [[#2275](https://github.com/airyhq/airy/issues/2275)] Fixing typos in webhook docs [[#2338](https://github.com/airyhq/airy/pull/2338)] - -#### 📚 Documentation - -- [[#2243](https://github.com/airyhq/airy/issues/2243)] Improve upgrade docs [[#2339](https://github.com/airyhq/airy/pull/2339)] -- [[#2335](https://github.com/airyhq/airy/issues/2335)] Update release process docs [[#2336](https://github.com/airyhq/airy/pull/2336)] - -#### 🧰 Maintenance - -- Bump sass from 1.38.2 to 1.39.0 [[#2377](https://github.com/airyhq/airy/pull/2377)] -- Bump react-router-dom from 5.2.1 to 5.3.0 [[#2373](https://github.com/airyhq/airy/pull/2373)] -- Bump core-js from 3.16.4 to 3.17.2 [[#2375](https://github.com/airyhq/airy/pull/2375)] -- Bump @babel/preset-env from 7.15.0 to 7.15.4 [[#2372](https://github.com/airyhq/airy/pull/2372)] -- Bump immer from 9.0.3 to 9.0.6 [[#2369](https://github.com/airyhq/airy/pull/2369)] -- Bump terser-webpack-plugin from 5.1.4 to 5.2.0 [[#2364](https://github.com/airyhq/airy/pull/2364)] -- Bump @typescript-eslint/eslint-plugin from 4.29.2 to 4.30.0 [[#2356](https://github.com/airyhq/airy/pull/2356)] -- Bump react-markdown from 7.0.0 to 7.0.1 [[#2365](https://github.com/airyhq/airy/pull/2365)] -- Bump @typescript-eslint/parser from 4.29.3 to 4.30.0 [[#2361](https://github.com/airyhq/airy/pull/2361)] -- Bump @types/node from 16.7.1 to 16.7.10 [[#2362](https://github.com/airyhq/airy/pull/2362)] -- Bump tar from 6.1.4 to 6.1.11 in /docs [[#2359](https://github.com/airyhq/airy/pull/2359)] -- Bump @types/react-window-infinite-loader from 1.0.4 to 1.0.5 [[#2348](https://github.com/airyhq/airy/pull/2348)] -- Bump core-js from 3.16.2 to 3.16.4 [[#2357](https://github.com/airyhq/airy/pull/2357)] -- Bump @typescript-eslint/parser from 4.29.2 to 4.29.3 [[#2350](https://github.com/airyhq/airy/pull/2350)] -- Bump eslint-plugin-react from 7.24.0 to 7.25.1 [[#2343](https://github.com/airyhq/airy/pull/2343)] -- Bump cypress from 8.3.0 to 8.3.1 [[#2344](https://github.com/airyhq/airy/pull/2344)] -- Bump @stomp/stompjs from 6.1.0 to 6.1.1 [[#2347](https://github.com/airyhq/airy/pull/2347)] -- Bump react-router-dom from 5.2.0 to 5.2.1 [[#2346](https://github.com/airyhq/airy/pull/2346)] -- Bump sass from 1.38.0 to 1.38.2 [[#2342](https://github.com/airyhq/airy/pull/2342)] -- Bump @typescript-eslint/eslint-plugin from 4.29.1 to 4.29.2 [[#2296](https://github.com/airyhq/airy/pull/2296)] - -#### Airy CLI - -You can download the Airy CLI for your operating system from the following links: - -[MacOS](https://airy-core-binaries.s3.amazonaws.com/0.30.0/darwin/amd64/airy) -[Linux](https://airy-core-binaries.s3.amazonaws.com/0.30.0/linux/amd64/airy) -[Windows](https://airy-core-binaries.s3.amazonaws.com/0.30.0/windows/amd64/airy.exe) -