Skip to content

Commit

Permalink
Merge pull request #30057 from appsmithorg/fix/promotion-blockers-jan-4
Browse files Browse the repository at this point in the history
fix: Adding release blocker fixes to master CE
  • Loading branch information
trishaanand authored Jan 5, 2024
2 parents 487f5a4 + 921bf12 commit ec95eb8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
20 changes: 14 additions & 6 deletions app/client/src/ce/selectors/applicationSelectors.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createSelector } from "reselect";
import { groupBy } from "lodash";
import { groupBy, memoize } from "lodash";
import type { AppState } from "@appsmith/reducers";
import type { WorkflowMetadata } from "@appsmith/constants/WorkflowConstants";
import type {
Expand All @@ -14,6 +14,7 @@ import { hasCreateNewAppPermission } from "@appsmith/utils/permissionHelpers";
import {
NAVIGATION_SETTINGS,
SIDEBAR_WIDTH,
type ThemeSetting,
defaultThemeSetting,
} from "constants/AppConstants";
import { getPackagesList } from "@appsmith/selectors/packageSelectors";
Expand Down Expand Up @@ -332,10 +333,17 @@ export const getCurrentPluginIdForCreateNewApp = (state: AppState) => {
return state.ui.applications.currentPluginIdForCreateNewApp;
};

const getMemoizedThemeObj = memoize(
(themeSetting: ThemeSetting | undefined) => {
return {
...defaultThemeSetting,
...themeSetting,
};
},
);

export const getAppThemeSettings = (state: AppState) => {
return {
...defaultThemeSetting,
...state.ui.applications.currentApplication?.applicationDetail
?.themeSetting,
};
return getMemoizedThemeObj(
state.ui.applications.currentApplication?.applicationDetail?.themeSetting,
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.springframework.util.StringUtils;
import org.springframework.web.reactive.function.client.ClientRequest;
import org.springframework.web.reactive.function.client.ExchangeFilterFunction;
import org.springframework.web.reactive.function.client.ExchangeStrategies;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;
import reactor.netty.http.client.HttpClient;
Expand All @@ -35,6 +36,8 @@ public class WebClientUtils {

public static final String HOST_NOT_ALLOWED = "Host not allowed.";

private static final int MAX_IN_MEMORY_SIZE_IN_BYTES = 16 * 1024 * 1024;

private static final InetAddressValidator inetAddressValidator = InetAddressValidator.getInstance();

public static final ExchangeFilterFunction IP_CHECK_FILTER =
Expand Down Expand Up @@ -75,6 +78,9 @@ public static WebClient.Builder builder(ConnectionProvider provider) {
public static WebClient.Builder builder(HttpClient httpClient) {
return WebClient.builder()
.filter(IP_CHECK_FILTER)
.exchangeStrategies(ExchangeStrategies.builder()
.codecs(configurer -> configurer.defaultCodecs().maxInMemorySize(MAX_IN_MEMORY_SIZE_IN_BYTES))
.build())
.clientConnector(new ReactorClientHttpConnector(makeSafeHttpClient(httpClient)));
}

Expand Down

0 comments on commit ec95eb8

Please sign in to comment.