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: braze transformation error due to wrong import #2901

Merged
merged 1 commit into from
Dec 13, 2023
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
2 changes: 1 addition & 1 deletion src/v0/util/errorTypes/filteredEventsError.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { BaseError } = require('./base');
const { BaseError } = require('@rudderstack/integrations-lib');
const { HTTP_STATUS_CODES } = require('../constant');

class FilteredEventsError extends BaseError {
Expand Down
2 changes: 1 addition & 1 deletion src/v0/util/errorTypes/transformerProxyError.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { BaseError } = require('@rudderstack/integrations-lib');
const tags = require('../tags');
const { BaseError } = require('./base');

const errorTypes = Object.values(tags.ERROR_TYPES);
const metaTypes = Object.values(tags.METADATA);
Expand Down
2 changes: 1 addition & 1 deletion src/v0/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const isPrimitive = (arg) => {
const isNewStatusCodesAccepted = (reqMetadata = {}) => {
if (reqMetadata && typeof reqMetadata === 'object' && !Array.isArray(reqMetadata)) {
const { features } = reqMetadata;
return !!(features && features[FEATURE_FILTER_CODE]);
return !!features?.[FEATURE_FILTER_CODE];
}
return false;
};
Expand Down
10 changes: 10 additions & 0 deletions src/v0/util/index.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { TAG_NAMES } = require('@rudderstack/integrations-lib');
const utilities = require('.');
const { getFuncTestData } = require('../../../test/testHelper');
const { FilteredEventsError } = require('./errorTypes');
const { hasCircularReference, flattenJson } = require('./index');

// Names of the utility functions to test
Expand Down Expand Up @@ -116,3 +118,11 @@ describe('flattenJson', () => {
);
});
});

describe('tests for generateErrorObject', () => {
test('test-0', () => {
const myErr = new FilteredEventsError('error-1');
const outputErrObj = utilities.generateErrorObject(myErr);
expect(outputErrObj.statTags).toEqual({});
});
});
4 changes: 1 addition & 3 deletions test/__tests__/data/braze_router.json
Original file line number Diff line number Diff line change
Expand Up @@ -841,9 +841,7 @@
},
{
"error": "[Braze Deduplication]: Duplicate user detected, the user is dropped",
"statTags": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we had test case too to validate the previous change then !

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes 🙁

"errorCategory": "transformation"
},
"statTags": {},
"statusCode": 298,
"batched": false,
"metadata": [
Expand Down
Loading