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: amplitude batch output metadata #3077

Merged
merged 3 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions src/v0/destinations/am/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ const {
getFieldValueFromMessage,
getValueFromMessage,
deleteObjectProperty,
getErrorRespEvents,
krishna2020 marked this conversation as resolved.
Show resolved Hide resolved
removeUndefinedAndNullValues,
isDefinedAndNotNull,
isAppleFamily,
isDefinedAndNotNullAndNotEmpty,
simpleProcessRouterDest,
isValidInteger,
handleRtTfSingleEventError,
} = require('../../util');
const {
BASE_URL,
Expand All @@ -40,7 +40,6 @@ const {
AMBatchSizeLimit,
AMBatchEventLimit,
} = require('./config');
const tags = require('../../util/tags');

const AMUtils = require('./utils');

Expand Down Expand Up @@ -904,16 +903,10 @@ const batch = (destEvents) => {
// this case shold not happen and should be filtered already
// by the first pass of single event transformation
if (messageEvent && !userId && !deviceId) {
const errorResponse = getErrorRespEvents(
metadata,
400,
const MissingUserIdDeviceIdError = new InstrumentationError(
'Both userId and deviceId cannot be undefined',
{
[tags.TAG_NAMES.ERROR_CATEGORY]: tags.ERROR_CATEGORIES.DATA_VALIDATION,
[tags.TAG_NAMES.ERROR_TYPE]: tags.ERROR_TYPES.INSTRUMENTATION,
},
);
respList.push(errorResponse);
respList.push(handleRtTfSingleEventError(ev, MissingUserIdDeviceIdError, {}));
return;
}
/* check if not a JSON body or (userId length < 5 && batchEventsWithUserIdLengthLowerThanFive is false) or
Expand Down
Loading
Loading