Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lambda): Respond rai seatool issue #1064

Closed
wants to merge 9 commits into from
Prev Previous commit
Next Next commit
try setting null explicitly instead of undefined
anyoussefinia committed Jan 30, 2025
commit 6a601ed64ddfd8dc43747cfec9dbeaaae8aed4fe
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ export const transform = () => {
id: data.id,
raiWithdrawEnabled: false,
makoChangedDate: data.timestamp ? new Date(data.timestamp).toISOString() : null,
raiReceivedDate: undefined,
raiReceivedDate: null,
cmsStatus,
stateStatus,
seatoolStatus: SEATOOL_STATUS.RAI_RESPONSE_WITHDRAW_REQUESTED,

Unchanged files with check annotations Beta

TOPIC,
);
expect(bulkUpdateDataSpy).toBeCalledWith(OPENSEARCH_DOMAIN, OPENSEARCH_INDEX, [

Check failure on line 289 in lib/lambda/sinkMainProcessors.test.ts

GitHub Actions / test

lambda/sinkMainProcessors.test.ts > insertOneMacRecordsFromKafkaIntoMako > should handle valid kafka records for withdraw-rai

AssertionError: expected "bulkUpdateData" to be called with arguments: [ …(3) ] Received: 1st bulkUpdateData call: Array [ "https://vpc-opensearchdomain-mock-domain.us-east-1.es.amazonaws.com", "test-namespace-main", Array [ Object { "cmsStatus": "Formal RAI Response - Withdrawal Requested", "id": "VA-11-2020", "locked": true, "makoChangedDate": "2024-11-26T18:17:21.557Z", + "raiReceivedDate": null, "raiWithdrawEnabled": false, "seatoolStatus": "Formal RAI Response - Withdrawal Requested", "secondClock": false, "stateStatus": "Formal RAI Response - Withdrawal Requested", }, ], ] Number of calls: 1 ❯ lambda/sinkMainProcessors.test.ts:289:31
{

Check failure on line 290 in lib/lambda/sinkMainProcessors.test.ts

GitHub Actions / coverage-report

lambda/sinkMainProcessors.test.ts > insertOneMacRecordsFromKafkaIntoMako > should handle valid kafka records for withdraw-rai

AssertionError: expected "bulkUpdateData" to be called with arguments: [ …(3) ] Received: 1st bulkUpdateData call: Array [ "https://vpc-opensearchdomain-mock-domain.us-east-1.es.amazonaws.com", "test-namespace-main", Array [ Object { "cmsStatus": "Formal RAI Response - Withdrawal Requested", "id": "VA-11-2020", "locked": true, "makoChangedDate": "2024-11-26T18:17:21.557Z", + "raiReceivedDate": null, "raiWithdrawEnabled": false, "seatoolStatus": "Formal RAI Response - Withdrawal Requested", "secondClock": false, "stateStatus": "Formal RAI Response - Withdrawal Requested", }, ], ] Number of calls: 1 ❯ lambda/sinkMainProcessors.test.ts:290:31
...expectation,
id: event.id,
makoChangedDate: ISO_DATETIME,
}, {} as any);
});
setAccordionValues(updateAccordions);
}, [url.state.filters, drawer.drawerOpen]);

Check warning on line 149 in react-app/src/components/Opensearch/main/Filtering/Drawer/hooks.ts

GitHub Actions / lint

React Hook useEffect has missing dependencies: 'accordionValues' and 'setFilters'. Either include them or remove the dependency array
const aggs = useMemo(() => {
return Object.entries(_aggs || {}).reduce(
},
{} as Record<opensearch.main.Field, { label: string; value: string }[]>,
);
}, [_aggs]);

Check warning on line 166 in react-app/src/components/Opensearch/main/Filtering/Drawer/hooks.ts

GitHub Actions / lint

React Hook useMemo has a missing dependency: 'labelMap'. Either include it or remove the dependency array
return {
aggs,
};
useEffect(() => {
onRequest(params.state);
}, [params.queryString]);

Check warning on line 74 in react-app/src/components/Opensearch/main/useOpensearch.ts

GitHub Actions / lint

React Hook useEffect has missing dependencies: 'onRequest' and 'params.state'. Either include them or remove the dependency array
return { data, isLoading, error, ...params };
};
export const useOsAggregate = () => {
return () => {
control.unregister(field.name);
};
}, []);

Check warning on line 33 in react-app/src/components/RHF/Slot.tsx

GitHub Actions / lint

React Hook useEffect has a missing dependency: 'field.name'. Either include it or remove the dependency array
return (
<FormItem
useEffect(() => {
handleSearch(debouncedSearchString);
}, [debouncedSearchString]);

Check warning on line 16 in react-app/src/components/SearchForm/index.tsx

GitHub Actions / lint

React Hook useEffect has a missing dependency: 'handleSearch'. Either include it or remove the dependency array. If 'handleSearch' changes too often, find the parent component that defines it and wrap that definition in useCallback
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
return () => {
events.forEach((event) => document.removeEventListener(event, handleEvents));
};
}, [timeout]);

Check warning on line 53 in react-app/src/hooks/useIdle/index.ts

GitHub Actions / lint

React Hook useEffect has a missing dependency: 'events'. Either include it or remove the dependency array
return idle;
}
return () => {
matchMedia.removeEventListener("change", handleChange);
};
}, [query]);

Check warning on line 29 in react-app/src/hooks/useMediaQuery.ts

GitHub Actions / lint

React Hook useEffect has a missing dependency: 'handleChange'. Either include it or remove the dependency array
return matches;
}
} catch {
return props.initValue;
}
}, [queryString]);

Check warning on line 25 in react-app/src/hooks/useParams.ts

GitHub Actions / lint

React Hook useMemo has a missing dependency: 'props.initValue'. Either include it or remove the dependency array
const onSet = (arg: (arg: T) => T | T, shouldIsolate?: boolean) => {
const val = (() => {