Skip to content

Commit 5c069d7

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
delete feature flag enable_query_renderer_set_state_prevention
Reviewed By: alunyov Differential Revision: D50332420 fbshipit-source-id: 9052fb2f83f036d2439c584ecd550c5bf3075d7c
1 parent 3d66ad8 commit 5c069d7

File tree

2 files changed

+2
-31
lines changed

2 files changed

+2
-31
lines changed

packages/react-relay/ReactRelayQueryRenderer.js

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -171,35 +171,8 @@ class ReactRelayQueryRenderer extends React.Component<Props, State> {
171171
const newState = resetQueryStateForUpdate(this.props, prevState);
172172
const {requestCacheKey, queryFetcher} = newState;
173173
if (requestCacheKey != null && requestCache[requestCacheKey] != null) {
174-
if (RelayFeatureFlags.ENABLE_QUERY_RENDERER_SET_STATE_PREVENTION) {
175-
// $FlowFixMe[incompatible-use]
176-
const fetchResult = queryFetcher.getFetchResult();
177-
if (fetchResult != null) {
178-
const snapshot = fetchResult.snapshot ?? null;
179-
const error = fetchResult.error ?? null;
180-
181-
const {requestCacheKey: prevRequestCacheKey} = prevState;
182-
if (prevRequestCacheKey != null) {
183-
delete requestCache[prevRequestCacheKey];
184-
}
185-
186-
newState.renderProps = getRenderProps(
187-
error,
188-
snapshot,
189-
// $FlowFixMe[incompatible-call]
190-
queryFetcher,
191-
prevState.retryCallbacks,
192-
);
193-
newState.snapshot = snapshot;
194-
newState.requestCacheKey = null;
195-
} else {
196-
// $FlowFixMe[incompatible-use]
197-
queryFetcher.setOnDataChange(this._handleDataChange);
198-
}
199-
} else {
200-
// $FlowFixMe[incompatible-use]
201-
queryFetcher.setOnDataChange(this._handleDataChange);
202-
}
174+
// $FlowFixMe[incompatible-use]
175+
queryFetcher.setOnDataChange(this._handleDataChange);
203176
}
204177
return newState;
205178
});

packages/relay-runtime/util/RelayFeatureFlags.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export type FeatureFlags = {
2828
STRING_INTERN_LEVEL: number,
2929
USE_REACT_CACHE: boolean,
3030
USE_REACT_CACHE_LEGACY_TIMEOUTS: boolean,
31-
ENABLE_QUERY_RENDERER_SET_STATE_PREVENTION: boolean,
3231
LOG_MISSING_RECORDS_IN_PROD: boolean,
3332
ENABLE_RELAY_OPERATION_TRACKER_SUSPENSE: boolean,
3433

@@ -63,7 +62,6 @@ const RelayFeatureFlags: FeatureFlags = {
6362
STRING_INTERN_LEVEL: 0,
6463
USE_REACT_CACHE: false,
6564
USE_REACT_CACHE_LEGACY_TIMEOUTS: true,
66-
ENABLE_QUERY_RENDERER_SET_STATE_PREVENTION: false,
6765
LOG_MISSING_RECORDS_IN_PROD: false,
6866
ENABLE_LOOSE_SUBSCRIPTION_ATTRIBUTION: false,
6967
ENABLE_OPERATION_TRACKER_OPTIMISTIC_UPDATES: false,

0 commit comments

Comments
 (0)