Skip to content

Commit

Permalink
fix: stringifying session ID for airship
Browse files Browse the repository at this point in the history
  • Loading branch information
shrouti1507 committed Nov 21, 2024
1 parent f580f20 commit d761727
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/v0/destinations/airship/data/airshipTrackConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
{
"destKey": "session_id",
"sourceKeys": ["properties.sessionId", "context.sessionId"],
"required": false
"required": false,
"metadata": {
"type": "toString"
}
},
{
"destKey": "transaction",
Expand Down
89 changes: 88 additions & 1 deletion test/integrations/destinations/airship/processor/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2296,7 +2296,7 @@ export const data = [
},
{
name: 'airship',
description: 'Test 22 : session id gets converted to v5 uuid format',
description: 'Test 22 : session id from Web SDK gets converted to v5 uuid format',
feature: 'processor',
module: 'destination',
version: 'v0',
Expand Down Expand Up @@ -2381,6 +2381,93 @@ export const data = [
},
},
},
{
name: 'airship',
description: 'Test 22 : session id from mobile SDK gets converted to v5 uuid format',
feature: 'processor',
module: 'destination',
version: 'v0',
input: {
request: {
body: [
{
message: {
channel: 'web',
context: {
app: {
build: '1.0.0',
name: 'RudderLabs JavaScript SDK',
namespace: 'com.rudderlabs.javascript',
version: '1.0.0',
},
traits: { email: '[email protected]', firstName: 'test', lastName: 'one' },
library: { name: 'RudderLabs JavaScript SDK', version: '1.0.0' },
userAgent:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
locale: 'en-US',
ip: '0.0.0.0',
os: { name: '', version: '' },
screen: { density: 2 },
sessionId: 1731403898,
},
type: 'track',
messageId: '84e26acc-56a5-4835-8233-591137fca468',
anonymousId: '123456',
event: 'Product Clicked',
userId: 'testuserId1',
properties: {},
integrations: { All: true },
},
destination: {
Config: {
apiKey: 'dummyApiKey',
appKey: 'ffdf',
dataCenter: false,
},
},
},
],
method: 'POST',
},
},
output: {
response: {
status: 200,
body: [
{
output: {
version: '1',
type: 'REST',
method: 'POST',
endpoint: 'https://go.urbanairship.com/api/custom-events',
headers: {
'Content-Type': 'application/json',
Accept: 'application/vnd.urbanairship+json; version=3',
'X-UA-Appkey': 'ffdf',
Authorization: 'Bearer dummyApiKey',
},
params: {},
body: {
JSON: {
user: { named_user_id: 'testuserId1' },
body: {
name: 'product_clicked',
session_id: 'd5627eac-795d-5005-9bb4-2c7c0af6cab0',
},
},
JSON_ARRAY: {},
XML: {},
FORM: {},
},
files: {},
userId: '',
},
statusCode: 200,
},
],
},
},
},
].map((tc) => ({
...tc,
mockFns: (_) => {
Expand Down

0 comments on commit d761727

Please sign in to comment.